Skip to content

Instantly share code, notes, and snippets.

@derofim
Last active July 12, 2016 20:49
Show Gist options
  • Save derofim/e865bd5b20f44294a5041162f04db869 to your computer and use it in GitHub Desktop.
Save derofim/e865bd5b20f44294a5041162f04db869 to your computer and use it in GitHub Desktop.
First time Git setup

Installing the Git

Firstly, we need to install Git. As we are familiar with using Ubuntu, all we got to do is, open the terminal and type the following:

$ sudo apt-get install git-core git-gui git-doc It’s your call, if you want to get the Git docs as well. Else the git-core files would be just enough.

Enter the user details.

Most importantly the username and the email. It has a significance though, as to why they are the most important. If there are 20 people involved on a single project, all the changes done by each of them are intimidated to all the people involved on that project. So we get a clear notification if a certain user has made certain changes to some file. Now, to update the username and the email, type the following in the terminal window:

git config --global user.name "your name here" git config --global user.email [email protected] We can check the status anytime by typing:

git config --list So, we are done with all the minimal configuration needed to start committing and pushing your codes. Also do remember, this is a one time setup and doesn’t need to done everytime we start with a new project.

Setting up the SSH key on our system (optional)

Now, we need to generate a SSH key for your system. It’s as easy as opening a terminal and typing ‘ssh-keygen‘ and then pressing enter. Follow the further instructions and you get the SSH key generated under the .ssh/id_rsa.pub file. No worries, the full path of the file shows up as soon as the SSH key gets generated.

Add your SSH key to GitHub

The next step is to paste the generated SSH key to the corresponding textarea on the Git profile page. So, proceeding step-wise,

Open the generated id_rsa.pub file on your system and copy all of its content. Login to Git. Go to your profile update page. You can see the textarea for ‘Add a public key’. Paste the content you copied in Step 1 to the textarea you focussed in Step 3 Click on ‘Update your account‘ button and done!

Save username and password

StackOverflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment