git 本地创建新的分支,并推送远程仓库

本地创建新的分支

git branch new-branch 创建新的分支new-branch

$ git branch download-api

切换至新的分支

$ git checkout download-api

将新分支推送至远程仓库

$ git push
fatal: The current branch download-api has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin download-api

当直接直接git push的时候,就会报错提示没有设置上游的远程仓库,只要按照提示执行即可。

$ git push --set-upstream origin download-api
Total 0 (delta 0), reused 0 (delta 0)
remote: Powered By Gitee.com
To gitee.com:kubernete/django-test.git
 * [new branch]      download-api -> download-api
Branch 'download-api' set up to track remote branch 'download-api' from 'origin'.
13423234-0e3934319aa622f6.png

你可能感兴趣的:(Git系列)