英文:
Push commits to local branch only not remote
问题
我在Bitbucket上有一个项目,我在本地克隆了它。当我切换到一个分支来开展一个新功能时,我希望我的提交只在本地功能分支上可用,然后在一切准备就绪时,将所有提交从本地分支推送到远程分支。
目前,当我使用git push
将提交推送到本地分支时,Git总是会抱怨这次推送,显示使用 git push --set-upstream <远程分支>
,然后退出。
如何实现这一目标?
英文:
I have a project on bitbucket the I cloned locally. when I checkout a branch to work on a feature I want my commits to be available on the local feature branch ONLY then when everything is good to go, push all commits from local branch to remote one.
Currently when I push commits to the local branch using git push
git always complains about this push, shows a use git push --set-upstream <remote branch>
and exits.
How can I achieve this?
答案1
得分: 1
所以你不需要推送。当你提交你的代码时,它会将你更新的代码存储在本地,不会将其发送到任何远程。
英文:
So you don't need to push. When you commit your code it stores your updated code locally and will not send it to any remote.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论