$ git remote show origin ... Local branch configured for 'git pull': master merges with remote master Local ref configured for 'git push': master pushes to master (up to date)
here you can see that for the git pull command (without parameters) only the local master branch is configured (updates will be taken from the remote master branch). similarly for git push (without parameters) - only updates from the local master branch will be sent to the remote repository (to the remote master branch).
The local branch can be configured to send changes to any branch of the remote repository (when calling git push with no parameters in this branch).
the easiest way to do this is by passing the -u ( --set-upstream ) option to the git push command once. Naturally, you need to specify both the repository name and the branch in it, to which the current branch will be “tied”.
for your particular case:
make the develop branch current:
$ git checkout develop
send the changes from it, while specifying the "binding" to the remote branch develop in the origin repository (an example of the output is also shown):
$ git push -u origin develop Total 0 (delta 0), reused 0 (delta 0) To url-репозитория * [new branch] develop -> develop Branch develop set up to track remote branch develop from origin.
The last line just reports that the local develop branch is “connected” to the remote develop branch (in the origin repository).
now the command:
$ git remote show origin
will show a little more information about the "bindings":
... Local branches configured for 'git pull': develop merges with remote develop master merges with remote master Local refs configured for 'git push': develop pushes to develop (up to date) master pushes to master (up to date)
and the git push command (without parameters) that is executed later in the develop branch will send the changes to the remote develop branch.
by the way
one-time to send changes from any local branch to (almost) any branch in the remote repository (and without performing any “bindings”), you can:
$ git push репозиторий локальная_ветка:удалённая_ветка
For example, for your case:
$ git push origin develop:develop
if the branch with the specified name does not exist in the remote repository, it will be created. and if it exists, then, in principle, the command may fail with an error - if you “merge” changes from a local branch into a remote branch, it will not work. but that's another story.
git remote show origin- aleksandr barakingit checkout develop && git push -u origin develop- KoVadim