My repo has two files: G.txt and I.txt. G.txt is edited by other users, while I am the only user who modifies I.txt, and I do not modify G.txt. My usual workflow is as follows:
I usually run into trouble because between steps 1 & 3, someone else has edited G.txt, so my push fails. People are quite often pushing to G.txt, so it is very difficult to fit my pull and push in before someone else does an edit. Is there a way to force the push to accept my change to I.txt, but not to overwrite the repo's G.txt since others have changed it since my last pull?
You can git pull --rebase: that will replay your local (with l.txt modification) commit on top of any other commit done on the remote side.
Then push again. No need for forcing the push in that case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With