0%

Useful Git Commands

  1. list the different files in two branches

    1
    git diff branch1 branch2 --stat
  2. list the differences in detail in two branches

    1
    git diff branch1 branch2
  3. Relpace one file from branch1 to branch2

    1
    2
    git checkout branch2
    git checkout --patch branch1 filename
  4. Start a new branch1

    1
    git checkout -b NewBranch
  5. List branches in remote git

    1
    git branch -a