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:

5019 questions
7266
votes
40 answers

How to remove local (untracked) files from the current Git working tree

How do you delete untracked local files from your current working tree?
readonly
  • 306,152
  • 101
  • 198
  • 201
3679
votes
22 answers

Make an existing Git branch track a remote branch?

I know how to make a new branch that tracks remote branches, but how do I make an existing branch track a remote branch? I know I can just edit the .git/config file, but it seems there should be an easier way.
Pat Notz
  • 186,044
  • 29
  • 86
  • 92
3347
votes
24 answers

How do you create a remote Git branch?

I created a local branch which I want to 'push' upstream. There is a similar question here on Stack Overflow on how to track a newly created remote branch. However, my workflow is slightly different. First I want to create a local branch, and I…
Jesper Rønn-Jensen
  • 91,561
  • 40
  • 112
  • 147
3033
votes
38 answers

How to get the current branch name in Git?

I'm from a Subversion background and, when I had a branch, I knew what I was working on with "These working files point to this branch". But with Git I'm not sure when I am editing a file in NetBeans or Notepad++, whether it's tied to the master or…
mike628
  • 36,755
  • 16
  • 37
  • 51
2550
votes
31 answers

Git fetch remote branch

My colleague and I are working on the same repository. We've branched it into two branches, each technically for different projects, but they have similarities, so we'll sometimes want to commit back to the *master from the branch. However, I have…
David
  • 28,483
  • 10
  • 38
  • 68
2207
votes
18 answers

Showing which files have changed between two revisions

I want to merge two branches that have been separated for a while and wanted to know which files have been modified. Came across this link: http://linux.yyz.us/git-howto.html which was quite useful. The tools to compare branches I've come across…
johannix
  • 27,528
  • 14
  • 37
  • 41
2152
votes
47 answers

How can I delete all Git branches which have been merged?

I have many Git branches. How do I delete branches which have already been merged? Is there an easy way to delete them all instead of deleting them one by one?
Nyambaa
  • 31,433
  • 9
  • 27
  • 34
2047
votes
18 answers

Branch from a previous commit using Git

If I have n commits, how can I branch from the n-3 commit? I can see the hash of every commit.
dole doug
  • 28,350
  • 20
  • 62
  • 84
1776
votes
32 answers

How to fetch all Git branches

I cloned a Git repository, which contains about five branches. However, when I do git branch I only see one of them: $ git branch * master I know that I can do git branch -a to see all the branches, but how would I pull all the branches locally so…
David542
  • 96,524
  • 132
  • 375
  • 637
1560
votes
31 answers

How can I get a list of Git branches, ordered by most recent commit?

I want to get a list of all the branches in a Git repository with the "freshest" branches at the top, where the "freshest" branch is the one that's been committed to most recently (and is, therefore, more likely to be one I want to pay attention…
Joe White
  • 87,312
  • 52
  • 206
  • 320
1421
votes
12 answers

Default behavior of "git push" without a branch specified

I use the following command to push to my remote branch: git push origin sandbox If I say git push origin does that push changes in my other branches too, or does it only update my current branch? I have three branches: master, production and…
Debajit
  • 43,330
  • 32
  • 87
  • 97
1215
votes
7 answers

What are some examples of commonly used practices for naming git branches?

I've been using a local git repository interacting with my group's CVS repository for several months, now. I've made an almost neurotic number of branches, most of which have thankfully merged back into my trunk. But naming is starting to become…
skiphoppy
  • 83,104
  • 64
  • 169
  • 214
1209
votes
21 answers

Can I recover a branch after its deletion in Git?

If I run git branch -d XYZ, is there a way to recover the branch? Is there a way to go back as if I didn't run the delete branch command?
prosseek
  • 155,475
  • 189
  • 518
  • 818
1201
votes
16 answers

What do "branch", "tag" and "trunk" mean in Subversion repositories?

I've seen these words a lot around Subversion (and I guess general repository) discussions. I have been using SVN for my projects for the last few years, but I've never grasped the complete concept of these directories. What do they mean?
grapefrukt
  • 26,815
  • 4
  • 46
  • 71
1074
votes
15 answers

master branch and 'origin/master' have diverged, how to 'undiverge' branches'?

Somehow my master and my origin/master branch have diverged. I actually don't want them to diverge. How can I view these differences and merge them?
Frank
  • 15,722
  • 9
  • 28
  • 30
1
2 3
99 100