Notes on Git

Notes on Git

I will continue to add some of the git cli- command , concepts and relevant references, which are relevant to my work.

Pull Request Tutorial

Git Command Line

Creating a branch, and then changing code on that branch , push to that branch and then create a pull request to later merge that branch to master

What is Squashing commits on Git

Squashing commits keyword hear to be confusing in the beginning, below reference provide very clear explanation

Squashing a commit means, from an idiomatic point of view, to move the changes introduced in said commit into its parent so that you end with one commit out of twos.
If you repeat this process multiple times, you can reduce n commit to a single one.

Delete an Existing Local Branch :

Switch to some other branch and delete Test_Branch, as follows:

$ git checkout master
$ git branch -d Test_Branch

How to apply 2FA to your new phone for GitHub

You can update your 2FA on your new phone by following the steps found here:

Clone the repository

git clone <repository_url>

Configure your Email and Name

eSumit@Sumits-MacBook-Pro:~$ git config –global –list

eSumit@Sumits-MacBook-Pro:~$ git config –global “Sumit Arora”

eSumit@Sumits-MacBook-Pro:~$ git config –global “”

Github Config
Github Config

diff between head and any commit

git diff commit_id HEAD

Combined various commits into one 

git rebase -i HEAD~5

It will open a text file with pick and commit liners , changes all the pick to f and keep the first one or use r to change the comment as well

exit from file, then do the below to push to remote

git push origin ZMDS4275 –force

git log –oneline

Refer :

List all branches

git branch -a 

Leave a Reply

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

You are commenting using your 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