Some Common Git commands:

Change username and email

  git config --global user.name "<username>"
  git config --global user.email "<email address>"

For undo the changes of Git

But chages are not commited yet :

  git checkout -f

For creating and moving to new branch:

  git checkout -b <branch name>

For deleting branch:

git branch -d <branch name>

and for deleting without merging the branch

git branch -D <branch name>

For commiting all modified files without use of git add command as a short cut:

git commit -a -m "<message of commit>"

For merging

git merge <branch name>

For reverting to any no of previous commits:

  git reset --soft HEAD~<no of commits to revert>
  git push origin master --force

Check Git Settings

 git config --list 

Remove Git Remote

 git remote rm destination 

Discard conflicts of git pull request

 git reset --merge 
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