Search code examples
gitgit-commitgit-pushgit-pull

Pull-Commit-Push or Commit-Pull-Push?


Which is preferable over the other and why? If I pull before commit, do the changes that other developers made merge with what I am currently working on? If so, that means this one is more preferable?


Solution

  • It's better to commit first. Pulling without commiting may make your work overwritten. With a local commit, conflicts will be shown and prompted for manual merging when pulling, giving you a better control over your work.