Posted By

jturmel on 07/13/09


Tagged

remote git branch


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

benjay
kmorey
caschbre


Create and track a remote branch in Git


 / Published in: Bash
 

  1. # Create the remote branch
  2.  
  3. git push origin origin:refs/heads/some_branch
  4.  
  5. # Make sure everything is up-to-date
  6.  
  7. git fetch origin
  8.  
  9. # Then you can see that the branch is created.
  10.  
  11. git branch -r
  12.  
  13. # This should show ‘origin/new_feature_name’
  14. # Start tracking the new branch
  15.  
  16. git checkout --track -b new_feature_name origin/some_branch
  17.  
  18. # This means that when you do pulls that it will get the latest from that branch as well.
  19. # Make sure everything is up-to-date
  20.  
  21. git pull

Report this snippet  

You need to login to post a comment.