GIt Branching

  • create branch

    $ git branch test
    
  • switch branches

    $ git checkout test
    
  • create and switch branch

    $ git checkout -b issue
    
  • delete branch

    $ git branch -d hotfix
    
  • merge branch to master

    $ git checkout master
    $ git merge issue
    
  • show branchs

    $ git branch
    #see the last commit on each branch
    $git branch -v
    
    #filter by if the branch are already merged into current branch
    $ git branch --merged
    $ git branch --no-merged
    

你可能感兴趣的:(GIt Branching)