Friday, March 31, 2017

Tips: Some common Git commands

- git status

- Revert deleting a file
git reset HEAD <file>

- Checking out
git checkout <branch_or_tag>

- Check the difference between the origin and the remote:
git diff origin/Nightly

- git add
- git add .
- git push origin <branch>
- git commit -a -m "message"
- git checkout <branch>
- git log
- git checkout -- .
- git pull origin
- git cherry-pick <commit_id>
- git reset HEAD~
- git log -p filename

- Hard reset
git reset --hard origin/Nightly

- Clean the untracked files/directories
git clean -f -d

- git fetch --all
- git reset --hard origin/master

No comments:

Post a Comment