Tag: git branch

Put current changes in a new Git branch

This question already has an answer here: Move existing, uncommited work to a new branch in Git 4 answers

Update an outdated branch against master in a Git repo

I have a Git repository that has branch (local and remote) that has become outdated. I would like to bring this branch up to date with the master branch, but I don’t know how to do this. There will also probably be many merge conflicts. How can I bring or update this out-of-date branch to […]

How can I delete (or merge) a local Git branch that I'm currently on?

I’m pretty new to using git, and I use it to contribute to the AOKP Android ROM. I’ve successfully created a few branches, modified the code, and uploaded the commits that have gotten merged on the remote end. But in my local repository, those branches are still showing up (even though they show up as […]

Git – move branch to master

I have a branch with actual sources and I did not make any commits for a long time to master, and at the moment it’s completely out of date. I want to just replace master’s content with the content of my branch. One way to do it is to checkout both branch and master, delete […]

Why can't a branch name contain the 'space' char?

I tried: git branch “MyProj/bin/ ignored” and received: fatal: ‘MyProj/bin/ ignored’ is not a valid branch name. The git-branch man page points to the git-check-ref-format man page to get the actual rules for a valid branch name. Sure enough, the reason for the above fatal error appears to be the inclusion of a space character. […]

How to find which git branch I am on when my disk is mounted on other server

Our git repo is on a Linux server; I can be on the master branch or create a new branch that I can go inside and use. Our git repo disk is mounted on AIX box to build (I can see git directory in the AIX box that allows me to build) In the AIX […]

Create a remote branch on GitHub

In SVN I have at least two ways to create a branch: svn cp /home/me/localcheckout/trunk /home/me/localcheckout/branches/newbranch svn cp http://server/trunk http://server/branches/newbranch The first creates it locally then I have to commit the whole branch. The second creates it on the server. The benefit of the second is that I can svn switch my local trunk, make […]

How do I make a branch point at a specific commit?

In Git, I understand that a branch is a pointer to a commit. How do I make a specific branch point to a specific commit? Say I want to make master point at 1258f0d0aae…, how do I do that?

How do I move a commit between branches in Git?

I’m sure this is a simple thing that has been asked and answered, but I don’t know what terms to search for. I have this: /–master–X–Y A–B \–C–D–E Where I commited C, D, and E (locally only) on a branch, but then I realized that D and E are really independent of C. I want […]

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 my_remote_branch:my_local_branch Is this the correct way?

Git Baby is a git and github fan, let's start git clone.