Local branch 'develop' has commits that do not exist in 'origin/develop'. Rebase 'develop' onto 'origin/develop', or drop local commits?
时间: 2023-12-03 14:03:33 浏览: 232
facepunch-commits:Facepunch Commits 网站的界面
It depends on what you want to achieve. If you have made local commits that are not yet pushed to the remote repository and you want to keep them, then you should rebase your local branch 'develop' onto the remote branch 'origin/develop'. This will apply your local commits on top of the remote branch, preserving your changes while also bringing in any changes made by others on the remote branch.
If you do not care about the local commits and just want to start fresh with the remote branch, then you can drop the local commits and reset your local branch to match the remote branch using the command:
```
git reset --hard origin/develop
```
This will discard any local commits and make your local branch identical to the remote branch.
阅读全文