git <branch> | lists all the branches |
git checkout <branch> | switches to <branch> |
git sudo update | it'll figure out the latest version of each package and its dependency, but will not download or install any of those updates. |
git sudo upgrade | downloads and installs the updates for each outdated package and dependency |
git pull | pulls all the latest files of the branch from remote repo |
git commit -m "msg" | adds log message |
git commit --amend -m "new_msg" | updates latest log message |
git commit --amend --author="xyz <xyz@gmail.com" --no-edit | updates author |
git config --global user.name "xyz" | - |
git config --global user.email "xyz@gmail.com" | - |
git push origin <branch> | pushes changes to remote branch |
git merge branch-1 | merges branch-1 changes to <current_branch> |
git reset --soft HEAD~1 | Delete the most recent commit, keeping the work you've done |
git reset --hard HEAD~1 | Delete the most recent commit, destroying the work you've done |
git reset HEAD^ | remove commit locally |
git push origin +HEAD | force-push the new HEAD commit. HEAD points to the top of the current branch. git can obtain the branch name from that. So it's the same as: git push origin CURRENT_BRANCH_NAME |