Answers for "push local repositoty but to new branch"

1

push project to new branch git

git push -u origin branchName
Posted by: Guest on December-07-2020
0

How do I push a new local branch to a remote Git repository and track it too?

Prior to the introduction of git push -u, there was no git push option to obtain what you desire. You had to add new configuration statements.

If you create a new branch using:

$ git checkout -b branchB
$ git push origin branchB:branchB
You can use the git config command to avoid editing directly the .git/config file:

$ git config branch.branchB.remote origin
$ git config branch.branchB.merge refs/heads/branchB
Or you can edit manually the .git/config file to add tracking information to this branch:

[branch "branchB"]
    remote = origin
    merge = refs/heads/branchB
Posted by: Guest on March-15-2022

Code answers related to "push local repositoty but to new branch"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language