Tag: git branch

Git: Managing multiple, similar yet slightly different repos

I’m a relative git newbie. I have a repo that got a little complex on me and I’ve now fallen down the rabbit hole. I started out with a Joomla site that had it’s own repo (we’ll call it Repo A). After that site had been launched, our client wanted us to develop 3 similar […]

Is it possible to have git automate resolution of a certain kinds of merge conflicts

We have two branches X and Y that have been branched at this point: test.txt dir/a.txt dir/b.txt Now branch X introduces some changes into dir/a.txt and a commit is created. Branch Y makes a commit where dir/ gets deleted. Then we want to merge X into Y. This will create a certain kind of “deleted-changed” […]

Errors when moving a specific commit to a new branch with Git

I have this: branch-1 a–b–c–d I need this: branch-1 a–c–d branch-2 b I tried this: $git checkout -b branch-2 $git cherry-pick <SHA-1 b> But I got this: error: could not apply <SHA-1 b>… [comment] hint: after resolving the conflicts, mark the corrected paths hint: with ‘git add <paths>’ or ‘git rm <paths>’ hint: and commit […]

Identifying branch of commits in Git after deleting a branch

I’m in the process of switching from subversion to Git, and I’m trying to get a better understanding of how I should manage branches. Say there is a bug in my software which is recorded as Issue 123 in my bug tracking system. I may create a new branch in git to fix the bug […]

Git: apply topic branch using rebase (without merge)

There is a small topic branch (on a contributor’s remote repo) that I’d like to apply on top of my master. I think the canonical way to do this is: git merge contributor/topic-branch But I’d like to have the commits applied one-by-one instead of generating a merge commit. Naively running git rebase contributor/topic-branch obviously won’t […]

How to git-log all branches that contain a specific commit

git log accepts multiple branch names as parameters, and using –graph you get a nice tree-view of it. With –all I see the complete tree, with –branches I can even filter branch names. I want to show the complete history of all (sub)branches of a specific branch. To that end, I want to know how […]

How to remove an unused GIT branch in Xcode?

I can see how to create a branch, but I would like to remove one that I will never use. There doesn’t seem to be such functionality in Xcode, so I tried in terminal doing git branch -d BugFixes but no luck.

What is the command equivalent to git clone -b on old Git versions?

A friend is stuck with an old version of Git (I think he said 1.5?), where he says the -b <branch> option is not supported. I can’t wrap my head around it, so I really hope someone could help: What would be the equivalent of the following command, without using -b? git clone -b $BRANCH […]

How do you rebase a git-svn branch and keep the metadata intact?

I recently used git svn branch to create a branch (in both Subversion and git). I noticed that (for some reason I’m not sure about; maybe a bug or maybe I created the branch incorrectly?) the git commit for the branch creation has two parents: one at the top of the tree at the time […]

safely delete a local branch after rebase – replace of git branch –merged

I had to change the commit message which was in an old commit in order to push it to a remote server. This commit was just on my machine so I could rebase it interactively and then amend it. I usually delete all my unused local branches after a push to a remote server and […]

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