I made a fork, cloned the repository, created a branch, now when I do git push on the gitHub, the branch does not appear.
But after I did git push --all appeared.
So it should be?
I made a fork, cloned the repository, created a branch, now when I do git push on the gitHub, the branch does not appear.
But after I did git push --all appeared.
So it should be?
You can create branches with different commands and with different options passed to the commands (some configuration options also affect this process. See man git-config ).
if you created a branch with the branch command:
$ git branch новая-ветка then you did not switch to this branch, the current branch remained the one that was before the execution of this command. accordingly, with the push command (without additional options / arguments) you tried to send changes from the current branch, which most likely already exists in the remote repository.
if you created a branch with the checkout command with the -b option:
$ git checkout -b новая-ветка then the switch to the new branch should have happened. but in this case the push command (without additional options / arguments) should return an error of the form:
$ git push fatal: The current branch новая-ветка has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin новая-ветка i.e., it would be necessary to specify an additional option (suggested directly in the error message) to bind a new branch to the same branch in a remote repository.
when you executed the push command with the --all option, then no matter which branch was current at that moment, git tried to create all the branches missing in the remote repository and send local changes to them. but the missing bindings (see paragraph 2 above) will not create the git program in this case: they must be created manually so that later you can execute the push command from the new branch without additional options / arguments.
http://rogerdudler.imtqy.com/git-guide/index.ru.html
You can create a new branch with the name "feature_x" and switch to it with the command
git checkout -b feature_x switch back to master
git checkout master delete branch
git branch -d feature_x the branch will not be accessible to those who use the remote repository with you until you send it there git push origin <имя_ветки>
Source: https://ru.stackoverflow.com/questions/530703/
All Articles
git push origin/branch_name- jekaby