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
61
votes
4 answers

How do I make git-svn use a particular svn branch as the remote repository?

A word of warning: I'm a n00b to git in general. My team uses feature branches in svn, and I'd like to use git-svn to track my work on a particular feature branch. I've been (roughly) following Andy Delcambre's post to set up my local git repo, but…
Hank Gay
  • 70,339
  • 36
  • 160
  • 222
60
votes
4 answers

How to protect "master" in github?

I have a few contributors in my github project. I want to allow only one of them to "push" to master. And this guy is not me (the owner of the repository). Is it possible to do?
yegor256
  • 102,010
  • 123
  • 446
  • 597
59
votes
9 answers

git push error: src refspec main does not match any on linux

whenever I'm trying to upload my files using git push -u origin main I'm getting error which is as follows error: src refspec main does not match any error: failed to push some refs to 'github.com:xxxxxx/xxx-project.git' but if I do git push -u…
Arka
  • 957
  • 1
  • 8
  • 18
59
votes
4 answers

How to move some changeset to a new branch in mercurial

I want to move a changeset from one branch to another. Basically, I currently have: A -> B -> C -> D # default branch And I want: A # default branch \-> B -> C -> D # some_new_branch Where some_new_branch does not exist yet. I am used to git, so…
David Cournapeau
  • 78,318
  • 8
  • 63
  • 70
58
votes
4 answers

Push branches to Git

I have a local repository I'm working on and its remote is hosted on GitHub. I recently created a branch and started working on it, making several commits and now wish to push the branch to GitHub and be able to pull it to another cloned repository.…
PHLAK
  • 22,023
  • 18
  • 49
  • 52
57
votes
4 answers

Git commit against tag with no branch

If I check out a tagged version of my source code without creating a branch, Git indicates that I'm not associated with any branch at all. It's happy to let me make changes and check them in though. Where do those changes go? If I switch back to…
Andrew
  • 11,894
  • 12
  • 69
  • 85
57
votes
7 answers

SVN branch compare

How do I compare one branch with another? I want to compare a branch with the latest revision in trunk.
tekumara
  • 8,357
  • 10
  • 57
  • 69
56
votes
3 answers

How to only push to one branch in Hg?

I have a Hg repo with 3 branches in it, but two of them are inactive (since I have already merged them into my default branch). hg heads shows 3 heads, one for each branch, even though hg branches shows 2 of those branches as 'inactive'. When I try…
simon
  • 3,380
  • 2
  • 22
  • 23
56
votes
7 answers

How do I rename branch on the GitHub website?

I don't know how to run command line stuff. I just don’t have the environment. So I'm trying to rename a branch on the GitHub website. It was, by default, named patch-1. Is it possible to rename it on the site?
Noitidart
  • 35,443
  • 37
  • 154
  • 323
55
votes
5 answers

Mercurial clone from a branch

We have a repository with three named branches, I wanted to clone one of the branches. Is there a mercurial command to do that? If I provide the path (of branch) with hg clone I get 404 error.
Abidi
  • 7,846
  • 14
  • 43
  • 65
55
votes
5 answers

Is it possible to retroactively turn a set of commits into a branch?

Say I have a git repository and I've been working on master, can I retroactively create a branch. For example: A - B - C - A1 - D - A2 - E I want to make it look like this: A - A1 - A2 \ \ B - C - D - E The specific use case is…
Otto
  • 18,761
  • 15
  • 56
  • 62
55
votes
11 answers

Subversion: howto find all revisions that are not merged to trunk?

Branching sources for release cycle is one of common source management scenarios. Merging as soon as possible is a good practice. Thus we have a human factor: branch is closed, but someone forgot to merge something back to trunk. Q: Is there a "one…
Dandikas
  • 2,426
  • 2
  • 24
  • 32
55
votes
8 answers

How do I configure Git to automatically pull from current branch when using "git pull"?

With our current setup you always have to enter the branch name (ie: git pull origin feature-branch" when doing a pull. I've already made the mistake of pulling from one branch into another, accidentally merging two branches with two very different…
Brandon Durham
  • 7,096
  • 13
  • 64
  • 101
54
votes
7 answers

Block a git branch from being pushed

Here's the situation: I have a public repository for my open-source app on github.com. However, now I'd like to write some specific code that will not be public (I might use it in a commercial version of my application). I figured I could use the…
houbysoft
  • 32,532
  • 24
  • 103
  • 156
54
votes
4 answers

Checkout branch on different remote

I have a repo that has another remote upstream besides origin. I can do git checkout origin/master, but when I run git checkout upstream/master, I get: error: pathspec 'upstream/master' did not match any file(s) known to git. This does not work…
Fish Monitor
  • 4,155
  • 3
  • 32
  • 53