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 be really helpful I guess.

4 Answers
4

Leave a Comment