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
52
votes
5 answers

How do you switch between branches in Visual Studio Code with Git?

I am trying to workout how branching works in Visual Studio Code and Git. Previously I've worked with TFS which was pretty simple - you create a branch and this is all stored in a separate folder on your disk so you can easily work on one branch or…
Paul
  • 621
  • 1
  • 5
  • 6
52
votes
5 answers

How to find origin of a branch in git?

Say if my project contains two masters (master and master_ios) and I want to see what the origin of a feature branch is (by origin, i mean the branch the feature branch is based off), how would I accomplish this in git?
dlucci
  • 729
  • 4
  • 9
  • 24
51
votes
3 answers

How to rename an SVN branch and update references in an existing sandbox?

I needed to rename a SVN branch, so I did: $ svn move https://server/repos/myrepo/branches/oldbranch \ https://server/repos/myrepo/branches/newbranch So far, so good -- the branch has been renamed. The trouble is, we have existing sandboxes…
Lee Netherton
  • 21,347
  • 12
  • 68
  • 102
51
votes
2 answers

What exactly do we mean by "branch"?

Long story short... As far as I can tell, the term "branch" (in Git parlance) may refer to related but different things: a non-symbolic reference/pointer to a commit, the name of such a reference (e.g. "master"), the subgraph of the repository's…
jub0bs
  • 60,866
  • 25
  • 183
  • 186
50
votes
4 answers

Git: created new branch from a wrong branch

I usually create new branch from develop git checkout -b new-feature develop then after the last commit I merge back to develop git checkout develop git merge new-feature but this time I created new-feature2 brach from new-feature and now I cannot…
hakunin
  • 4,041
  • 6
  • 40
  • 57
50
votes
3 answers

Git: Merge in only one commit

Usually, I work with branches in Git, but I don't like to see hundreds of branches in my working tree (Git history). I'm wondering if there is a method in Git to "join" all commits in a branch in only one commit (ideally with a clear commit…
Ivan
  • 14,692
  • 17
  • 59
  • 96
49
votes
3 answers

Delete a local development branch

I have recently cloned a repo of our development code branch in my system: git clone https://gitserver.com/product After the clone was successful I get the below status on query: $ git branch * develop I realized that now this branch needs to be…
Programmer
  • 8,303
  • 23
  • 78
  • 162
49
votes
4 answers

warning: refname 'xxx' is ambiguous when using git-svn

I am using git as a frontend to Subversion (via git svn). So, for every svn trunk/branch I have remote branch in git named "remotes/xxx". For example "remotes/trunk", "remotes/coolfeature". Now I want have one "default" local branch for every remote…
Ivan Dubrov
  • 4,778
  • 2
  • 29
  • 41
49
votes
3 answers

Subversion branch reintegration in v1.6

Per this old question, using SVN 1.5, reintegrating a branch multiple times is problematic, and should be avoided. There has been some rumbling to the effect that, "This is a known issue, and should be fixed in SVN 1.6." Was that the case? Is it…
Andres Jaan Tack
  • 22,566
  • 11
  • 59
  • 78
49
votes
3 answers

Why can't I push this change to my 'main' mercurial repository?

I am trying to grok Mercurial and hope I am just getting confused here! I have a repository ('main') that I have cloned ('clone'), , both on my own machine. Both were completely in sync with each other. I decided to play with named branches so the…
Neil Trodden
  • 4,724
  • 6
  • 35
  • 55
49
votes
2 answers

Git: move a commit "on top"

Let's say in master I have a feature disabled. I work on that feature on branch feature, so I have a special commit $ there that just enables that feature. Now I want to merge the changes I did in feature into master, but keep the enabling commit…
Adrian Panasiuk
  • 7,249
  • 5
  • 33
  • 54
48
votes
3 answers

Git: Merge to master while automatically choosing to overwrite master files with branch

I am using Git to track my documentation latex source. I want to keep the master branch full of documents that are suitable for end user release, so when someone needs something, i can just switch to the master branch, compile and hand out the…
Mica
  • 18,501
  • 6
  • 46
  • 43
47
votes
9 answers

Show the original branch for a commit

I've used git-blame to find a particular commit. Now I want to find the branch that it originally came from. (From there, I'll use the branch name to find the particular ticket) Let's define "original branch" as "the branch to which the commit was…
Craig Walker
  • 49,871
  • 54
  • 152
  • 212
47
votes
5 answers

Efficiency of branching in shaders

I understand that this question may seem somewhat ungrounded, but if someone knows anything theoretical / has practical experience on this topic, it would be great if you share it. I am attempting to optimize one of my old shaders, which uses a lot…
Yippie-Ki-Yay
  • 22,026
  • 26
  • 90
  • 148
47
votes
6 answers

How to know if latest commit to master has been pushed to the remote?

I have merged a branch in to master and now I can see that in my git log Some time has passed and now I want to know whether I previously also pushed master (with that commit) to the remote. How can I tell if it has been pushed? I can think of a…
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497