![]() I always execute git push first and then copy the command and paste it. ![]() Git push -set-upstream origin my-test-branch To push the current branch and set the remote as upstream, use $ git pushįatal: The current branch my-test-branch has no upstream branch. We can upload the new repository with git push but it shows an error because the destination is unknown yet. Let’s push it to the remote repository since it’s still only in the local. $ git log -onelineġd6c1d2 (HEAD -> my-test-branch) Add test_file.txtģ665d26 (origin/main, origin/HEAD, main) Update select row with shift key It is not pushed to the remote repository. The previous command just creates a new branch in the local repository. It shows the most used commands in daily work.Ģ021.02.17 How to push a new branch to the remote branch Execute git pull first to update the current repository to the latest state.Ĭheck the following post if you are not familiar with git commands. Make sure that you are in the right place to create a new branch. This means that a new branch is created based on the current branch. This command is a shortcut command of the following two commands. Switched to a new branch 'my-test-branch' A new branch can be created in the following command. There is only main branch in the repository at the moment.įirstly, we need to create a branch. Related Articles How to create a branch.How to remove multiple branches with regex.How to remove multiple branches at once.How to remove a branch from local repository.How to push a new branch to the remote branch.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |