tagged [git-branch]

Move existing, uncommitted work to a new branch in Git

Move existing, uncommitted work to a new branch in Git I started some work on a new feature and after coding for a bit, I decided this feature should be on its own branch. How do I move the existing u...

9 Oct at 05:1

How do I create a new Git branch from an old commit?

How do I create a new Git branch from an old commit? > [Branch from a previous commit using Git](http://stackoverflow.com/questions/2816715/branch-from-a-previous-commit-using-git) I have a Git bran...

24 Jan at 22:18

Remove tracking branches no longer on remote

Remove tracking branches no longer on remote Is there a simple way to delete all tracking branches whose remote equivalent no longer exists? Example: Branches (local and remote) - - - - - Locally, I o...

13 Aug at 13:38

How to replace master branch in Git, entirely, from another branch?

How to replace master branch in Git, entirely, from another branch? I have two branches in my Git repository: 1. master 2. seotweaks (created originally from master) I created `seotweaks` with the int...

19 Aug at 18:8

How to pull remote branch from somebody else's repo

How to pull remote branch from somebody else's repo I've got a project hosted on GitHub which somebody has forked. On their fork, they've created a new branch "foo" and made some changes. How do I pul...

How to download a branch with git?

How to download a branch with git? I have a project hosted on GitHub. I created a branch on one computer, then pushed my changes to GitHub with: Now I am on a different computer, and I want to downloa...

14 Feb at 16:34

Renaming branches remotely in Git

Renaming branches remotely in Git If there is a repository that I only have `git://` access to (and would usually just push+pull), is there a way to rename branches in that repository in the same way ...

23 Mar at 11:31

How do I merge my local uncommitted changes into another Git branch?

How do I merge my local uncommitted changes into another Git branch? How can I do the following in Git? My current branch is branch1 and I have made some local changes. However, I now realize that I a...

11 Apr at 00:41

Create Git branch with current changes

Create Git branch with current changes I started working on my branch thinking that my task would be easy. After a while I realized it would take more work and I want to do all this work in a new bran...

11 Apr at 11:40

What are the differences between git branch, fork, fetch, merge, rebase and clone?

What are the differences between git branch, fork, fetch, merge, rebase and clone? I want to understand the difference between a branch, a fork and a clone in Git? Similarly, what does it mean when I ...

25 Apr at 15:17

Push commits to another branch

Push commits to another branch Is it possible to commit and push changes from one branch to another. Assume I commited changes in and want to push them to . From , is it valid to do: And then reset BR...

7 Jul at 12:29

How to commit my current changes to a different branch in Git

How to commit my current changes to a different branch in Git Sometimes it happens that I make some changes in my working directory, and I realize that these changes should be committed in a branch di...

4 Dec at 13:5

Find out which remote branch a local branch is tracking

Find out which remote branch a local branch is tracking > [How can I see which Git branches are tracking which remote / upstream branch?](https://stackoverflow.com/questions/4950725) How can I find ...

16 Mar at 00:55

Cleaning up old remote git branches

Cleaning up old remote git branches I work from two different computers (A and B) and store a common git remote in the dropbox directory. Let's say I have two branches, master and devel. Both are trac...

14 Apr at 11:32

Rename master branch for both local and remote Git repositories

Rename master branch for both local and remote Git repositories I have the branch `master` which tracks the remote branch `origin/master`. I want to rename them to `master-old` both locally and on the...

17 Apr at 18:24

Git: Merge a Remote branch locally

Git: Merge a Remote branch locally I've pulled all remote branches via `git fetch --all`. I can see the branch I'd like to merge via `git branch -a` as remotes/origin/branchname. Problem is it is not ...

23 Jul at 11:4

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

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 th...

28 Jul at 09:16

Git "error: The branch 'x' is not fully merged"

Git "error: The branch 'x' is not fully merged" Here are the commands I used from the master branch Then I made some changes to my files, committed the changes, and pushed the new branch to GitHub. La...

21 Aug at 18:53

Git: Find the most recent common ancestor of two branches

Git: Find the most recent common ancestor of two branches How to find the most recent common ancestor of two Git branches?

10 Nov at 12:33

fetch in git doesn't get all branches

fetch in git doesn't get all branches I have cloned a repository, after which somebody else has created a new branch, which I'd like to start working on. I read the manual, and it seems dead straight ...

11 Jan at 15:12

How to keep a branch synchronized/updated with master?

How to keep a branch synchronized/updated with master? At the moment git is doing my head in, I cannot come up with the best solution for the following. There are two branches, one called and one call...

9 Apr at 00:28

Git merge hotfix branch into feature branch

Git merge hotfix branch into feature branch Let’s say we have the following situation in Git: 1. A created repository: mkdir GitTest2 cd GitTest2 git init 2. Some modifications in the master take plac...

What is the difference between origin and upstream on GitHub?

What is the difference between origin and upstream on GitHub? What is the difference between `origin` and `upstream` on [GitHub](http://en.wikipedia.org/wiki/GitHub)? When a `git branch -a` command is...

3 Jul at 22:46

How can I copy the content of a branch to a new local branch?

How can I copy the content of a branch to a new local branch? I have worked on a local branch and also pushed the changes to remote. I want to revert the changes on that branch and do something else o...

19 Jul at 09:4

How do I create a master branch in a bare Git repository?

How do I create a master branch in a bare Git repository? (Folder is created with git-ish files and folders inside) (Okay, so I can't use git status with a bare repo; makes sense I guess) (Nothing, it...

3 Aug at 10:24