Git : Some usefull commands

1. To view all update history of a file

git log --follow -p -- 

2.Different between working file and last commit file

git diff

3. Discard all current working update

git checkout . 

4. Discard the all the update on

git checkout

5. Create a new branch from current branch and checkout to that branch.

git checkout -b new_branch_name

6. Push the new local branch to remote branch

git push origin new_branch_name_to_update_remote

7. Remove all untracked files

git clean -f 


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 )

Google+ photo

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


Connecting to %s