Home > Net >  When is a good time to use Git fetch?
When is a good time to use Git fetch?

Time:11-20

If a remote repo's branch is only maintained by me, I never have to do a git fetch, is that a correct statement?

Just want to confirm my guess.

CodePudding user response:

If you have a remote repo and you are the only user and you never make any changes at the remote side (such as adding a readme file or making and merging a pull request), then you are correct: you are using the remote solely for backup and all you ever have to do is push to it. This is because when you push, your remote-tracking branches are brought up to date.

But if the remote has other users who are able to make changes at the remote side (by pushing etc.), then you would need to fetch periodically in order to being your remote-tracking branches up to date.

  • Related