There is a local git repository, one or several remote repositories added. There are several local branches in the repository.
How quickly and conveniently to see which branches of which remotes they are configured to push and pull?
There is a local git repository, one or several remote repositories added. There are several local branches in the repository.
How quickly and conveniently to see which branches of which remotes they are configured to push and pull?
Basic information can be obtained with the following command:
$ git branch -vv bar b6c2674 ... buzz 4422cf4 [origin/buzz: ahead 4] ... fizz 9ea2227 [origin/fizz: behind 1] ... * foo 04c196f [origin/foo: gone] ... master 4422cf4 [origin/master] ... More about different output options:
The bar branch does not have a corresponding remote branch.
bar b6c2674 ... The buzz branch is configured to pull from the buzz branch of the origin repository, which is locally represented by the origin / buzz branch and is 4 times ahead of it.
buzz 4422cf4 [origin/buzz: ahead 4] ... The fizz branch is configured to pull from the origin / fizz branch and remains at 1 commit.
fizz 9ea2227 [origin/fizz: behind 1] ... The foo branch is configured to pull from the origin / foo branch, but the origin repository no longer contains the foo branch. An asterisk * means that we are currently on the foo branch.
* foo 04c196f [origin/foo: gone] ... The master branch is configured to pull from the origin / master branch and fully complies with it.
master 4422cf4 [origin/master] ... The previous method does not give information about push configuration. Usually these settings are identical, but you can do otherwise. Therefore, let's suspect the worst, especially if we are looking at branches on someone else's machine.
git remote show origin This command shows a lot of information about one remote repository, including tracking settings for branches.
Source: https://ru.stackoverflow.com/questions/609292/
All Articles