我在我的本地系统中有2个分支,名为A
和B
。我结帐到B
意味着现在我在B
。我写了一些代码,在该分支中提交,但我没有将分支推送到远程。现在我结帐到A
,在那里我遇到了一些问题,所以我想将B
推送到远程。如何推分支到远程
是否可以从分支推送到另一个分支?
我面对的分公司A
此问题:
- 结帐从
B
到A
后,它显示public/index.html: Permission denied
。 我试图从
A
结帐到B
,但它不允许我。它显示以下消息:error: Your local changes to the following files would be overwritten by checkout: public/index.html Please, commit your changes or stash them before you can switch branches. Aborting
。
如何不丢失我在分支B
中写的代码?
我跑你的第一个命令,但它显示'$ git存储 public/index.html:权限被拒绝 没有本地更改来保存'.尽管我运行剩余的命令它不工作。 – user3279058
试试这个'$ sudo git stash' – Agis
它显示'sh.exe':sudo:command not found'。 – user3279058