Tag: branch

Git: how to merge modified files only

I have the following problem: We have a large product which is in master branch. Also we have other branches that have only few files, the files that are specific to this branch only. Each of those branches represent a plugin to the main product. So for example when you get the main product, you […]

Showing git branch in shell prompt?

I am trying to get my shell prompt to display the current git branch name. I have read a few tutorials and blog posts etc. and as far as I understand I’m doing everything correctly but it doesn’t seem to be working. I would like the prompt to look like this: dannys-macbook:hillcrest-store [master]$ but currently […]

Recover unreferenced commits from remote git repository

Here’s the situation : some commits have been done in a remote repository. Unfortunately, someone did push -f such that no remote branch references these commits anymore. To make matters worse, I don’t have those commits in my local clone. My goal is basically to recover those commits. These are some of the things I […]

Git branch experiment

Here’s an interesting experiment with using Git. Think of Github’s ‘pages’ feature: I write a program in one branch (e.g. master), and a documentation website is kept in another, entirely unrelated branch (e.g. gh-pages). I can generate documentation in HTML format from the code in my master-branch, but I want to publish this as part […]

Git – push to a remote-tracking branch in the remote repository

When simply doing git push to a remote repository, its master branch gets updated. This is undesirable in the case of non-bare repositories, and the warning message displayed by recent Git versions makes that clear. I’d like to be able to push to a remote repository, and have one of its remote tracking branches be […]

git merge manipulates the history

In our team, the regular procedure is that when we have a significant feature we work on a feature branch. Every now and then – we merge from master to out feature branch and when we’re ready – we merge back to master (usually through a pull request). The problem is that as after the […]

How to only merge changes added after a certain revision (both ways)?

Can git merge mostly ignore some file deletions and file renames between two branches, while merging only subsequent changes to the files that were renamed (and ignoring changes to the files that were deleted in one branch), back and forth between the two branches? Thus, I would like to be able to merge changes both […]

Cannot open FETCH_HEAD after renaming a branch

After having renaming the ‘master’ branch (using Sourcetree), I can’t fetch anymore the changes done in the remote repository. I get the error: error: cannot open .git/FETCH_HEAD: Permission denied When I open this file, I see that the referenced branch is still set toward branch ‘master’. Taking a look at the remote repository, I saw […]

JGit : How to get Branch when traversing repos

The lacking JGit docs dont seem to say anything about how to use/detect branches while using a RevWalk. This question says pretty much the same thing. So my question is: How do I get the branch name/id from a RevCommit? Or how do I specify which branch to traverse before hand?

Show all branches that commit A is on and commit B is not on?

I have multiple branches and have discovered a commit A that introduced a bug into the system. This was subsequently fixed by commit B on one of the branches and merged back to master, but at the time it was not cherry-picked to all offending branches. I was wondering if there is a command that […]

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