If you git pull --rebase --autosquash I (believe) git does something like git stash git fetch git rebase origin/current-branch branch git stash pop
At each of these stages, if there is a merge conflict, git will pause and wait for you to mark the conflicts as resolved. How you resolve the conflicts is largely dependent on your workflow. Maybe you use an IDE to resolve conflicts. Maybe you use git merge-tool Maybe you edit the files by yourself Maybe you resolve all conflicts as ours/theirs/both using sed <https://stackoverflow.com/a/68498101>. The correct way is very much dependent on your preference, your environment, your project etc. If I were you I'd do a couple of things. Create a tag at the head of your branch before pull --rebase. I use the convention archive/main-2021-12-23T13.27.50 Create a tag of your current copy of the remote branch (typically origin/branch-name) Tags are helpful to "save" the state of your branch. If you ever want to go back, do git switch branch-name && git reset --hard tag-name It's in many ways easier that using the reflog to undo havoc caused by rebase etc. Try git pull --rebase --autostash If there are no conflicts. Great. If there are conflicts. Resolve them. You can then easily inspect the changes introduced using git diff ORIG_HEAD HEAD If the conflicts are in such a way that you want your version, or the remote version, to take precedence. Use a merge strategy <https://git-scm.com/docs/git-pull#_merge_strategies> On Wednesday, December 22, 2021 at 3:16:47 PM UTC+1 nobodyIsMe wrote: > Hi, > > Can someone tell me if I did a git pull - - rebase -- autostash what can I > do next to keep my local changes before I do a git pull ? > > So, the things is there is some changes at my local but at the remote > there are also some changes. > > I'd like to know the correct way to resolve the conflicts before I push up > to the branch that I have cloned. > > Thanks. > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/1bbf3621-258f-48b3-a566-5d994305c6e1n%40googlegroups.com.
