Setting up Cygwin with Git Tutorial

Step 1: Download and install Cygwin.

Add additional packages to the Cygwin setup. Advance through the setup wizard accepting all default options until the “Select Pages” dialog is reached. Enter the word git into the Search input field and from the filtered list presented in the main dialog form select all relevant Git packages as per the following image:

Cygwin & Git

Cygwin & Git

Select “Next” until the selected options as added to the local Cygwin installation.

Also search ssh and install as required.

Step 2: Configure global Git settings.

Create the global Git configuration file a.k.a .gitconfig and place into the user’s Cygwin home folder. The following can be used as a template when creating this new resource:

Ensure to replace the placeholders marked “FILL” with your own details before saving to the local directory. This file needs to be saved to the root of your cygwin account (usually referred to as ~/.gitconfig) and to the Git home directory under “C:\ProgramData\Cygwin\home\USER” where USER needs to be replaced with your username (e.g. john).

Step 3: Setup SSH key in Stash.

If you are using Stash as the remote Git repository. Similar config might be required if you are using GitHUb as your repository as well to do SSH.

If you haven’t already, generate an RSA SSH key pair (public + private) using Cygwin’s ssh-keygen utility as show in the image below:

Cygwin & Git setting up SSH keys

Cygwin & Git setting up SSH keys

press “Enter” through the questions prompted.

Step 4: Copy the public key to the clipboard

Now, login to Stash (you should already have an account to do this) and once logged in, head to the Manage Account page by clicking on the Profile drop down menu in the top right-hand corner of the screen . Add the public key.

Setting up .bashrc, inputrc, etc

For example, .bashrc file may look like


300+ Java & Big Data Interview FAQs

16+ Java Key Areas Interview Q&As

800+ Java Interview Q&As

300+ Java & Big Data Tutorials

Top