
(a) if you have 2 commits only locally that you haven't pushed to the remote yet, your local branch is "2 commits ahead" of its remote counterpart branch. Git can now inform you about "unpushed" and "unpulled" commits. Even more importantly than being "easier", this also prevents you from making mistakes! You can simply use the shorthand commands "git pull" and "git push" - instead of having to think about the exact parameters like in "git push origin dev". Pushing and pulling becomes a lot easier. This relationship is invaluable for two reasons: And let's also say that you have set it up to track the "dev" branch on the remote named "origin". Let's say your current local HEAD branch is named "dev". Why should you set up tracking connections?

Your local branch now has a "counterpart" on the remote server. However, when you tell a local branch to "track" a remote branch, you create a connection between these two branches.

Download Now for Free What are tracking connections in Git?īy default, branches in Git have nothing to do with each other.
