Git – Configuration and Basic Commands – Part 1

Create account in https://github.com – I’ve created my own “sangitaccount”

Git_Profile

Go to “Settings” – Most of the sections are self explanatory – We are interested in “SSH and GPG Keys”. We can access the repository either using HTTPS OR SSH. As we are going to use SSH style need to the key.

Git_SSH1.JPG

As we are going to integrate Jenkins with Git – I will generate keys for Jenkins user and add public key to my account.

Jenkins_Keys.JPG

Git_SSH2

Install git on your local system and do basic configuration.

Git_Install.JPG

You may want to change the username, email to see who is pushing the changes.

Reference: https://help.github.com/articles/setting-your-username-in-git/#platform-linux

If you add “git config –global” applied to all repositories. Ignore global for config changes to single repository.

More examples:

Git does strict SSL check while using “https” and if you have locally generated certificate it may fail so ignore the SSL verification. You can do git config http.sslVerify “false”. in your specific repo to disable SSL certificate checking for that repo only.

While using https we can ask Git to save credentials in the cache. Ref: https://help.github.com/articles/caching-your-github-password-in-git/#platform-linux

Git_Config.JPG

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s