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
175
votes
15 answers

How to discard all changes made to a branch?

I'm working in a branch (i.e. design) and I've made a number of changes, but I need to discard them all and reset it to match the repository version. I thought git checkout design would do it, but it just tells me I'm already in branch design and…
Will
  • 5,370
  • 9
  • 35
  • 48
172
votes
5 answers

How to list all unmerged changes in Git?

Creating a branch for various topics, and not regularly deleting them when I don't need them any more, I have now ended up with about 50 branches. I tried deleting branches but some of them have unmerged changes. What I want is the ability to see…
lprsd
  • 84,407
  • 47
  • 135
  • 168
172
votes
2 answers

Visualize branches on GitHub

In TortoiseGit, gitk or on BitBucket, it is common to have a visualization of the project history with all the branches, like this: However, GutHub's commit history seems to be flat, at least I couldn't find a way to display this kind of graph. Can…
Borek Bernard
  • 50,745
  • 59
  • 165
  • 240
171
votes
6 answers

Rebasing remote branches in Git

I am using an intermediate Git repository to mirror a remote SVN repository, from which people can clone and work on. The intermediate repository has its master branch rebased nightly from the upstream SVN, and we are working on feature branches.…
kfb
  • 6,252
  • 6
  • 40
  • 51
167
votes
8 answers

How to 'git pull' into a branch that is not the current one?

When you run git pull on the master branch, it typically pulls from origin/master. I am in a different branch called newbranch, but I need to run a command that does a git pull from origin/master into master but I cannot run git checkout to change…
Malvineous
  • 25,144
  • 16
  • 116
  • 151
167
votes
7 answers

Pull request without forking?

Here are steps of code contribution from the topic "How do I contribute to other's code in GitHub?" Fork the project Make one or more well commented and clean commits to the repository. You can make a new branch here if you are modifying more than…
Jasper
  • 5,090
  • 11
  • 34
  • 41
164
votes
3 answers

How do you branch and merge with TortoiseSVN?

How do you branch and merge with Apache Subversion using the TortoiseSVN client?
cmcculloh
  • 47,596
  • 40
  • 105
  • 130
163
votes
5 answers

Update a local branch with the changes from a tracked remote branch

I have a local branch named 'my_local_branch', which tracks a remote branch origin/my_remote_branch. Now, the remote branch has been updated, and I am on the 'my_local_branch' and want to pull in those changes. Should I just do: git pull origin…
skyork
  • 7,113
  • 18
  • 63
  • 103
158
votes
4 answers

How do I switch to another subversion branch in Intellij?

What is the concept of switching branches in IntelliJ? I must be either blind or an idiot... I would assume there'd be a "switch to copy" option or something like that, but there is none... EDIT for clarification: my prev IDE had a simple "switch to…
PeterP
  • 4,502
  • 7
  • 22
  • 21
154
votes
10 answers

git: rename local branch failed

I don't know why my attempt of renaming local branch failed. I basically cloned the project, then I also have a submodule within the project, and I downloaded the submodule code as well. However, when I use git branch within the submodule, I have: *…
Shang Wang
  • 24,909
  • 20
  • 73
  • 94
153
votes
4 answers

What is a git topic branch?

What is a git topic branch? Does it differ from an ordinary branch in some way? Are there any branches that are not topic branches?
skiphoppy
  • 97,646
  • 72
  • 174
  • 218
153
votes
5 answers

How can I combine two commits into one commit?

I have a branch 'firstproject' with 2 commits. I want to get rid of these commits and make them appear as a single commit. The command git merge --squash sounds promising, but when I run git merge --squash my terminal just brings up options for the…
Don P
  • 60,113
  • 114
  • 300
  • 432
152
votes
6 answers

Why should I use tags vs. release/beta branches for versioning?

I've been using git for about a year and would like to use tagging to, well, tag commits at different versions. I've found lots of info on the commands to use to work with tags, but what I'd like to know is why use tagging at all if I can just…
wufoo
  • 13,571
  • 12
  • 53
  • 78
152
votes
2 answers

How can I print the log for a branch other than the current one?

I'm on a branch with some changes. Changing branch is a pain as some files are locked by processes, so to change branch I'd have to stop all the processes which have locks, then stash the changes before checking out the other branch to see its…
BanksySan
  • 27,362
  • 33
  • 117
  • 216
146
votes
4 answers

How do I create a new branch?

How do I create a new branch with my working copy using TortoiseSVN? I see the branch option, but I don't see a way to name it somehow.
the_drow
  • 18,571
  • 25
  • 126
  • 193