I'm a collaborator on a project. The owner usually works on different files. How can I avoid that the master diverges?
The situation on github
fileA # modified by owner
fileB
fileC
Locally:
fileA
fileB
fileC # modified by me
I noted that fileA
was changed. Thus I tried git fetch
, since I aimed to updated fileA
locally. Then I committed my fileC
and executed git push
, which now yields
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ...
Then it suggests git pull
and I get some merging stuff.
How can I avoid those problems (and branches)? I see git push
, git rebase
, git fetch
.