![]() ![]() Upstream branches also help us to easily compare our local branch with the remote branch.This may not seem like a great advantage but proves to be very helpful when working on a lot of different branches. We can directly use the Git Push and Git Pull commands without specifying the remote or the remote branch name. Upstream branches make it very easy to push and pull changes.There are two major advantages of setting upstream branches for our local branches. A local branch called master is also created that has the remote master branch as its upstream. If we clone this remote repository to our local system, then it will create a remote-tracking branch called origin/master that tracks the remote master branch. In most cases, the Tracking Branch tracks the Remote-Tracking Branch.Ĭonsider the following scenario where we have a remote repository with a master branch having three commits. A Tracking branch is a branch that tracks another branch.These remote-tracking branches are created by Git when we clone a repository and they play an important role when fetching or pulling changes from the remote repository. A Remote-Tracking branch is a branch that tracks changes to a remote branch. ![]() Let's first try to understand what remote-tracking branches and tracking branches are. All the changes of this remote branch can be pulled by the local branch and, the local branch can push changes to the upstream. The remote branch is called the upstream of the local branch.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |