How to add and delete remote branches in git
(written by lawrence, however indented passages are often quotes)
SourceThe Workflow
My workflow is generally something like this:
Create a remote branch
Create a local branch that tracks it
Work, Test, Commit (repeat) – this is all local
Push (pushes commits to the remote repository)
Git commands can be a bit esoteric at times and I can’t always seem to remember how to create a remote git branch and then start working on new code. There also seems to be multiple ways of doing it. I’m documenting the way that seem to work for me so that I can remember it. Maybe it will help someone else too.Creating a Remote Branch
1. Create the remote branch
git push origin origin:refs/heads/new_feature_name
2. Make sure everything is up-to-dategit fetch origin
3. Then you can see that the branch is created.git branch -r
This should show ‘origin/new_feature_name’4. Start tracking the new branch
git checkout –track -b new_feature_name origin/new_feature_name
This means that when you do pulls that it will get the latest from that branch as well.5. Make sure everything is up-to-date
git pull
January 10, 2012 1:09 pm
From lawrence on Fred Dewey is misunderstood
"Thank you, Charlotte. But what is the main advantage of Kachingle for you? You could perhaps find a more direc..."