Recently started working with git.
What difference does pull before commit or after commit , and is there any at all?

  • 6
    What is the connection? These commands do completely different loosely related actions. Maybe you need to read a textbook? - Alexey Ten

1 answer 1

In general, there is no difference. If there is no conflict in your changes and changes from upstream, then everything will pass without questions. If there is a merge conflict, git will somehow inform about it, and in any case you will have to solve it.

But I would prefer to first commit to commit the changes. Then it will be easy to roll back to the original version of your changes, if something goes wrong.

If you don't want to do a commit for some reason (for example, the work is not completed), you can temporarily hide the changes with the git stash command, then do git pull , and then return the changes with the git stash apply . This is a separate section in the documentation .

  • Everything is just like that, but I would just do git pull first. Habit constantly reap get latest version. In 99% of smerditsya automatic, and if it doesn’t sdurgitsya - then this is another reason to see how the arrived commit affects your work and whether you need to redo it (and even cancel it, yes, sometimes it happened). - AK
  • @Alex if the answer helped you, mark it as accepted, please. - cronfy 2:19