Questions tagged [branch]

A "branch" is a term used in version control systems to represent an independent line of development. Depending on the system, a repository can contain one or more branches. Branches are merged when changes need to propagate from one branch into another.

A "branch" is a term used in version control systems to represent an independent line of development. Depending on the system, a repository can contain one or more branches. Branches are merged when changes need to propagate from one branch into another.

Source: Wikipedia Branch (Version Control)

Related tags:

5403 questions
118
votes
4 answers

svn : how to create a branch from certain revision of trunk

The following action will only create a branch from the head revision of the trunk. How do I create a branch from a specific revision? Thanks. $ svn copy http://svn.example.com/repos/calc/trunk \ …
pierrotlefou
  • 39,805
  • 37
  • 135
  • 175
115
votes
1 answer

git remote prune – didn't show as many pruned branches as I expected

From the man page: Deletes all stale tracking branches under . These stale branches have already been removed from the remote repository referenced by , but are still locally available in "remotes/". So I removed a bunch of…
Felixyz
  • 19,053
  • 14
  • 65
  • 60
115
votes
4 answers

Following git-flow how should you handle a hotfix of an earlier release?

If you try to follow the git-flow branching model, documented here and with tools here, how should you handle this situation: You have made a 1.0 release and a 2.0 release. Then you need to make a hotfix for 1.0. You create a hotfix branch off the…
Klas Mellbourn
  • 42,571
  • 24
  • 140
  • 158
113
votes
12 answers

When should you branch?

When working with a SCM system, when should you branch?
Ben Aston
  • 53,718
  • 65
  • 205
  • 331
113
votes
4 answers

Git: How to list commits on this branch but not from merged branches

Suppose your git commit history looks like this: A---B---C---D---E---F master \ / X---Y---Z topic Is it possible to have git list only the commits on master, A-F? In other words, if the commit was on a merged-in branch, I don't…
wch
  • 4,069
  • 2
  • 28
  • 36
112
votes
6 answers

Switch on another branch (create if not exists), without checking if already exists?

git checkout -b foo switches on foo branch (even if it doesn't exist, it is created), but if the foo branch already exists it throws an error like this: fatal: A branch named 'foo' already exists. What's the command that does the following…
Ionică Bizău
  • 109,027
  • 88
  • 289
  • 474
111
votes
2 answers

Pull all commits from a branch, push specified commits to another

I have the following branches: master production and the following remote branches: origin/master origin/production I have a script that fetches the origin/master branch and gets the diff of what changed from my last fetch (log -p…
Sylvain
  • 3,202
  • 5
  • 27
  • 27
109
votes
4 answers

Install Gem from Github Branch?

In my gemfile I have this: gem "authlogic", :git => "git://github.com/odorcicd/authlogic.git", :branch => "rails3" How do I install that as a gem so I can test it?
Lance
  • 75,200
  • 93
  • 289
  • 503
109
votes
3 answers

Take all my changes on the current branch and move them to a new branch in Git

I started work on what I thought would be a minor bug fix on my master branch. However, it has spiraled out of control to the point where I wish I had created a separate branch to do the development in the first place. So right now what I'd like to…
Tom Lehman
  • 85,973
  • 71
  • 200
  • 272
107
votes
5 answers

Switch branch names in git

There may be more than one way to ask this question, so here's a desciption of the problem. I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before…
Daniel Benamy
  • 1,133
  • 2
  • 10
  • 8
105
votes
12 answers

Best branching strategy when doing continuous integration?

What is the best branching strategy to use when you want to do continuous integration? Release Branching: develop on trunk, keep a branch for each release. Feature Branching: develop each feature in a separate branch, only merge once stable. Does…
KingNestor
  • 65,976
  • 51
  • 121
  • 152
105
votes
5 answers

Can I unshelve to a different branch in tfs 2008?

Let's assume that some developer in my team shelved his changes that he did in branch A. And I am working on branch B. Can I unshelve his changes into branch B? (By GUI or command prompt)
spinodal
  • 4,007
  • 3
  • 29
  • 38
104
votes
8 answers

Is there a script to list git branches created by me?

I'm aware that branches don't really store creator information - and they're just a pointer to a commit. My goal is to be able to clean out my old branches that have been merged back to the main branch, and list branches where this hasn't been done…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
100
votes
4 answers

Rebasing a branch including all its children

I have the following Git repository topology: A-B-F (master) \ D (feature-a) \ / C (feature) \ E (feature-b) By rebasing feature branch I expected to rebase the whole subtree (including child branches): $ git rebase…
Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
100
votes
5 answers

When is the right time to delete a git feature branch?

I don't want to end up with 82 feature branches hanging around, so I'm wondering what the potential drawbacks are to simply deleting the feature branch as soon as I merge it to master. Workflow: git co -b feat-xyz hack hack git ci hack some more git…
bstpierre
  • 30,042
  • 15
  • 70
  • 103