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
8004
votes
41 answers

How do I remove local (untracked) files from the current Git working tree?

How do I delete untracked local files from the current working tree?
readonly
  • 343,444
  • 107
  • 203
  • 205
3990
votes
23 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
  • 208,672
  • 30
  • 90
  • 92
3884
votes
50 answers

How do I get the current branch name in Git?

How do I get the name of the current branch in Git?
mike628
  • 45,873
  • 18
  • 40
  • 57
3676
votes
25 answers

How do I create a remote Git branch?

I created a local branch. How do I push it to the remote server? UPDATE: I have written a simpler answer for Git 2.0 here.
Jesper Rønn-Jensen
  • 106,591
  • 44
  • 118
  • 155
3080
votes
31 answers

`git fetch` a remote branch

The remote repository contains various branches such as origin/daves_branch: $ git branch -r origin/HEAD -> origin/master origin/daves_branch origin/master How do I switch to daves_branch in the local repository so that it tracks…
David
  • 34,836
  • 11
  • 47
  • 77
2585
votes
51 answers

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

How do I delete branches which have already been merged? Can I delete them all at once, instead of deleting each branch one-by-one?
Nyambaa
  • 38,988
  • 9
  • 29
  • 35
2523
votes
22 answers

Branch from a previous commit using Git

If I have N commits, how do I branch from the N-3 commit?
dole doug
  • 34,070
  • 20
  • 68
  • 87
2334
votes
21 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 (moved to web.archive.org) which was quite useful. The tools to compare…
johannix
  • 29,188
  • 15
  • 39
  • 42
2256
votes
34 answers

How do I fetch all Git branches?

I cloned a Git repository containing many branches. However, git branch only shows one: $ git branch * master How would I pull all the branches locally so when I do git branch, it shows the following? $ git branch * master * staging * etc...
David542
  • 104,438
  • 178
  • 489
  • 842
1521
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
  • 46,327
  • 33
  • 91
  • 100
1519
votes
24 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
  • 182,215
  • 215
  • 566
  • 871
1355
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
  • 97,646
  • 72
  • 174
  • 218
1303
votes
20 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
  • 18,432
  • 9
  • 30
  • 30
1210
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
  • 27,016
  • 6
  • 49
  • 73
1208
votes
25 answers

Find out which remote branch a local branch is tracking

See also: How can I see which Git branches are tracking which remote / upstream branch? How can I find out which remote branch a local branch is tracking? Do I need to parse git config output, or is there a command that would do this for me?
readonly
  • 343,444
  • 107
  • 203
  • 205
1
2 3
99 100