team (shown and its approximate output)
$ git branch -r origin/Π²Π΅ΡΠΊΠ°1 origin/Π²Π΅ΡΠΊΠ°2 repo2/Π²Π΅ΡΠΊΠ°3 repo3/Π²Π΅ΡΠΊΠ°4
will show all branches of all remote repositories connected to your local repository.
repositories appear under those (arbitrary) names under which they are connected. in this case: origin , repo2 and repo3 .
origin name β by default, assigned to the remote repository, for example, when running git clone .
in principle, to send changes from the current branch to any of the branches of any of the connected repositories, you can perform:
$ git push ΠΈΠΌΡ-ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ ΠΈΠΌΡ-Π²Π΅ΡΠΊΠΈ
For the example above, you can send changes to, for example, origin/Π²Π΅ΡΠΊΠ°2 , like this:
$ git push origin Π²Π΅ΡΠΊΠ°2
but sending changes from an arbitrary local branch to an arbitrary remote one most likely will not work and you may receive an error of the form:
error: src refspec branch2 does not match any
This suggests that you must explicitly indicate the source . it can be the name of a local branch, a hash of a particular commit or a label (including βspecialβ - HEAD , which indicates the current commit where your working copy of the repository is switched). like that:
$ git push ΠΈΠΌΡ-ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ ΠΈΡΡΠΎΡΠ½ΠΈΠΊ:Π²Π΅ΡΠΊΠ°
but this is not a "victory" either. most likely, you may receive an error of the form:
To url repository
! [rejected] source -> branch (non-fast-forward)
error: failed to push some refs to 'url repository'
hint: Updates were rejected because of a remote branch
hint: counterpart. Check out this branch and merge the remote changes
hint: (eg 'git pull') before pushing again.
hint: See the git push - help for the details.
this means that your current commit cannot be linked by a chain of commits to a commit pointed to by a remote branch (remember, a branch in git is just a floating pointer to a commit).
and you had to act a little differently.
for example:
create a local branch based on the remote one and switch to it:
$ git checkout -b Π²Π΅ΡΠΊΠ°2 origin/Π²Π΅ΡΠΊΠ°2
- make the necessary changes, make the necessary commits.
send these changes to the remote repository:
$ git push
beta-branchin the project on the local repository and push it, will it be right? - YoroDiallogit branch -rcommand to the question - this is the display of branches in all remote repositories connected to your local one. You can change the question by clicking the edit below question text. - aleksandr barakingit branch -rcommand, all remote branches are displayed. to launch it you need to do a similar operation - git push github.comsomething / project.git beta-branch? - YoroDiallo