我默认创建了第一个主分支。
我签出一个名为“prd”的新分支,我希望它推送到远程源,但在新分支上。
我试着做:
$ git push -u origin/prd prd
但是控制台记录了:
fatal: 'origin/prd' does not appear to be a git repository
fatal: Could not read from remote repository.
有人可以帮我吗?
# Create a new branch:
git checkout -b branch_name
# Edit, add and commit your files.
# Push your branch to the remote repository:
git push -u origin branch_name
这应该有效。
-u
标志是-set-upstream
的缩写,它需要一个存储库名称。在这种情况下,存储库有一个别名origin
。第二个参数是分支的名称。
$ git push origin prd