我正在学习git而且我完全迷失了:
我想做以下事情:
我该怎么做?
我正在考虑做以下事情:
git branch -a
then
git checkout remote/branch_name
git add .
git commit -m "..."
git push (which would push to the remote)
这是你怎么做的>
答案 0 :(得分:-1)
如果更改存储库的历史记录,则将拒绝远程推送。你必须强行推动。
你正在使用的git命令
git branch -a
then
git checkout remote/branch_name
git add .
git commit -m "..."
git push (which would push to the remote)
可以向存储库添加新提交,但不会更改历史记录。
您可以使用
重写历史记录git rebase -i <commit>
然后推送到远程仓库
git push --force origin <branch>