AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Git set upstream8/17/2023 # and have 2 and 3 different commits each, respectively. # Your branch and 'origin/development' have diverged, Git tells you about this right in the output for "git status": $ git status (b) if, on the other hand, there are 4 commits on the remote branch that you havent downloaded yet, then your local branch is '4 commits behind' its remote counterpart branch. This information helps tremendously in staying up-to-date. (a) if you have 2 commits only locally that you havent pushed to the remote yet, your local branch is '2 commits ahead' of its remote counterpart branch. (b) if there are 4 commits on the remote upstream branch which you haven't pulled yet, then your local branch is "4 commits behind" its upstream branch. (a) if you have 2 commits in your local repository which you haven't pushed to the remote yet, then your local branch is "2 commits ahead" of its upstream branch. Git can now also tell you about unsynced commits which you haven't pushed or pulled, yet. With an upstream branch set, 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 development". This relationship is very helpful for two reasons: This configuration will tell git to show the relationship between. Let's also say that you've set the remote "origin/development" as its upstream branch. merge configuration entries to mark the start-point branch as upstream from the new branch. /) (see git-config (1) ).Let's say that your current local HEAD branch is named "development". The default for tosetupmerge means that the upstream configuration for a new branch is only automatically set when creating a branch from a remote-tracking branch (e.g. It lets you change the default remote branch. Why should you set up an upstream branch for a local branch? By git set-upstream, you can determine where your current local branch will flow. In practice, however, in makes lots of sense to see them as counterparts - connected in a so-called "tracking connection". In theory, local and remote branches in Git are completely separate items.
0 Comments
Read More
Leave a Reply. |