Check branch
1 |
git branch <name new branch> |
Show changes after your last commit
1 |
git diff |
rollback to previous change (specific file) to the latest commit
1 |
git checkout -- testfile |
Delete branch
1 |
git branch -D <branch name> |
Push new branch to the origin (my ‘git space’)
1 |
git push -u origin <branch name> |
Restore file from upstream
1 |
git checkout upstream/master -- <filename> |
Commit changes in one single line
1 |
git commit -a -m "comment" |
If you want to merge the recent changes committed on the master branch into your dev branch
1 2 3 |
git checkout dev # gets you "on branch dev" git fetch origin # gets you up to date with origin git merge origin/master |
If you want to reset ALL from the version ‘on the web’
1 2 |
git fetch origin git reset --hard origin/<branch> |