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

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

How can I push a local Git branch to a remote with a different name easily?

I’ve been wondering if there’s an easy way to push and pull a local branch with a remote branch with a different name without always specifying both names. For example: $ git clone myrepo.git $ git checkout -b newb $ … $ git commit -m “Some change” $ git push origin newb:remote_branch_name Now if someone … Read more

How can I find the location of origin/master in git, and how do I change it?

I’m a Git newbie. I recently moved a Rails project from Subversion to Git. I followed the tutorial here: http://www.simplisticcomplexity.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/ I am also using unfuddle.com to store my code. I make changes on my Mac laptop on the train to/from work and then push them to unfuddle when I have a network connection using the … Read more

How to add a local repo and treat it as a remote repo

I’m trying to make a local repo act as a remote with the name bak for another local repo on my PC, using the following: git remote add /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git bak which gives this error: fatal: ‘/home/sas/dev/apps/smx/repo/bak/ontologybackend/.git’ is not a valid remote name I’m trying to sync two local repos, with one configured as a remote … Read more