Git pull after local commit

I am new to git. I have several local commits, but I want to get the latest code from the repository and still do not want to push mine. However, git pull creates unnecessary merges. What is the right way to do this. Update the local repository without losing any changes.

+4
source share
1 answer

The tool you are looking for is git rebase , although you should look at the documentation for this before using it. In general, as a rule, it is good practice to develop at a local branch in order to reduce the overhead of such operations.

When it’s convenient for you, you can use git pull --rebase to use rebase, and not to merge, to resolve the differences after pull, but read the documents first, because it can lose data or cause headaches if used incorrectly. This is a useful but dangerous tool.

+7
source

Source: https://habr.com/ru/post/1397940/


All Articles