Useful Git Commands
I’ve been using GIT for a while, but it’s always useful to have a short list of the commands you use ona daily basis. So here’s my short list of GIT commands. Enjoy
- Clone repo:
git clone [remote URL] - Stage files:
git add [-A -f] . - Commit:
git commit -a -m '[Comment] ' - Pull:
git pull origin [branch name] - Push:
git push origin [branch name] - Get remote info:
git remote -v - Create new branch:
git checkout -b [branch name] - Merge branch:
git checkout master, git merge [branch name] - Delete local branch:
git branch -d [branch name] - Delete remote:
git push origin --delete [branch name] - Tag branch:
git tag -a [tag] -m "Comment" - Add remote origin:
git remote add origin [remote URL]