Everyday GIT Commands
We often use GIT but not regular that’s why its hard to remember all GIT commands. I also find myself looking up the some basic commands so I thought I had few to share with you. Hope these will be helpful for you.
Create and Checkout a New Branch
- #branches from currently checked out directory
- git checkout -b <branchName>
Checkout a Remote Branch
- git checkout -b <localBranchName> origin/<remoteBranchName>
Abort Changes of a File
- git checkout – <fileName>
Modify the Previous Commit’s Message
- git commit –amend
Partial Change Checkin
- git add –edit
Undo the Previous Commit
- git revert HEAD^
Temporarily Stash Changes, Restore Later
- # After changes have been made…
- git stash
- # Do some other stuff here, like switch branches, merge other changes, etc.
- #Re-apply the changes
- git stash pop
Delete a Remote Branch
- git push origin :<branchName>
Pull in the Latest from a Shared Repository
- # Add a remote branch
- git remote add <remoteName> <gitAddress>
- # Get changes from that branch
- git fetch <remoteName>
Tagging, Deleting, and Pushing Tags
- # Create a Tag
- git tag <tagName>
- # Delete the tag
- git tag -d <tagName>
- # Push Tags
- git push –tags
Hope these basic git commands should help you on your way.
Follow @phpzag

useful article dude,
Some of them like removing remote branch and tags was very useful for me,
Thank You
wonderful put up, very informative. I ponder why the other specialists of this sector don’t realize this. You must proceed your writing. I am confident, you have a great readers’ base already!
This blog has inspired me to continue focusing on my own blog