Most Useful Git commands

I have decided to stick with love. Hate is too great a burden to bear.

  1. List all the branches : git branch
  2. Pull the recent changes: git pull
  3. Create a feature branch : git checkout -b <new branch name> <parent branch name>
  4. Delete branch local: git branch -d <branch-name> or git branch -D <branch-name>
  5. Delete branch from remote : git push origin –delete <branch_name>
  6. See all remote branches: git branch -v -a
  7. Get conflicted list of files: git diff –name-only –diff-filter=U
  8. git fetch origin (checkout new remote branch)
    1. git checkout -t origin/remote-branch
  9. List all remote branches: git branch -r ()