What are the differences between local branch, local tracking branch, remote branch and remote tracking branch?

I just started using Git and I got really confused between different branches. Can anyone help me to figure out what the following branch types are? local branches local tracking branches remote branches remote tracking branches What is the difference between them? And how do they work with each other? A quick demo code will … Read more

Why does git-rebase give me merge conflicts when all I’m doing is squashing commits?

We have a Git repository with over 400 commits, the first couple dozen of which were a lot of trial-and-error. We want to clean up these commits by squashing many down into a single commit. Naturally, git-rebase seems the way to go. My problem is that it ends up with merge conflicts, and these conflicts … Read more

Find out a Git branch creator

I want to find out who created a branch. I am sort of able to do so with: git branch -a | xargs -L 1 bash -c ‘echo “$1 `git log –pretty=format:”%H %an” $1^..$1`”‘ _ However, this returns the last committer per branch, not necessarily the person who created the branch. 12 Answers 12

Git branching: master vs. origin/master vs. remotes/origin/master

I think I’m on the right track to understand the basic concepts of git. I’ve already set up and cloned a remote repository. I also created a server side empty repository, and linked my local repository to it. My problem is that I don’t understand the difference between: origin/master vs. remotes/origin/master As far as I … Read more

Is there a better way to find out if a local git branch exists?

I am using the following command to find out if a local git branch with branch-name exists in my repository. Is this correct? Is there a better way? Please note that I am doing this inside a script. For this reason I’d like to use plumbing commands if possible. git show-ref –verify –quiet refs/heads/<branch-name> # … Read more