Tag: branch

git remote prune – didn't show as many pruned branches as I expected

From the man page: Deletes all stale tracking branches under <name>. These stale branches have already been removed from the remote repository referenced by <name>, but are still locally available in “remotes/<name>”. So I removed a bunch of branches using git push origin :staleStuff and then ran git remote prune origin However, only one single […]

Split a git branch into two branches?

I’m trying to help out a coworker who accidentally created one feature branch from another feature branch, rather than creating the second one from master. Here is essentially what we have now… Master —A—B—C \ Foo E—F—F—H \ Bar J—K—L—M And here is what we’d like to have… Master —A—B—C |\ Foo | E—F—F—H | […]

git-svn branching

I am using git with an svn repository everything is going fine I did all my branching with git so I did not branch on svn but I branched with git and pushed those branches to a separate location. Then I commited changes from the branch when needed. But now I want to create some […]

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 it’s master branch rebased nightly from the upstream SVN, and we are working on feature branches. For example: remote: master local: master feature I can successfully push my feature branch […]

How do I rename my git 'master' branch to 'release'?

We would like to enforce a new policy for our projects that the master branch now be called the release branch to ensure it is more clear as to how the branch should be used. Naturally, we will have develop and release candidate branches as well. I understand I can rename the master branch locally […]

Git: “Not currently on any branch.” Is there an easy way to get back on a branch, while keeping the changes?

So I’ve done some work in the repository and when I’m about to commit I realize that I’m not currently on any branch. This happens a lot when working with submodules and I am able to solve it, but the process is tedious and I’ve been thinking that there must be an easier way to […]

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 the selected branch until after the pull is complete. […]

Git: How to find out on which branch tag is?

I’m currently busy with project with a lot of branches and I have a tag for last changes which where done on one of the branches. But it’s not clear for me on which branch this tag. How to find out on which branch tag is?

Git: copy all files in a directory from another branch

How do I copy all files in a directory from another branch? I can list all of the files in that directory by doing git ls-tree master:dirname I can then copy all of the files individually by doing git checkout master — dirname/filename However, using wildcards has so far been a total fail. This does […]

Git merge errors

I have a git branch called 9-sign-in-out with perfectly working code, and I want to turn it into the master. I’m currently on the master branch. $ git branch 9-sign-in-out * master I’m trying to switch to 9-sign-in-out branch, but it doesn’t allow me to: $ git checkout 9-sign-in-out app/helpers/application_helper.rb: needs merge config/routes.rb: needs merge […]

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