30
loading...
This website collects cookies to deliver better user experience
git checkout -b <new_branch_name>
git add .
git add <path/to/file>
git commit -m "Some changes"
git commit -m "Some changes" --no-verify
git reset --hard
git log
git pull
git pull origin/<branch_name>
git reset --soft HEAD~1
HEAD~1
means that your head is pointing on one commit earlier than your current - exactly what you want.git revert <commit_hash>
// stash your changes
git stash
// check out and review your teammate's branch
git checkout <your_teammates_branch>
... code reviewing
// check out your branch in progress
git checkout <your_branch>
// return the stashed changes
git stash pop
pop
seems familiar here? Yep, this works like a stack.git fetch origin
git reset --hard origin/<branch_name>
git cherry-pick <commit_hash>
git cherry-pick <oldest_commit_hash>^..<newest_commit_hash>