Answer the question
In order to leave comments, you need to log in
How to get auto-merged git pull changes without conflicts? Is the more recent change the main one?
I am using GIT to keep my personal knowledge base in sync. The knowledge base is a set of several thousand *.txt, *.html, *.xml files.
To sync I use the following "universal" command:
git add . ; git commit -a -m MyCommit ; git pull -s recursive -X theirs ; git push
Answer the question
In order to leave comments, you need to log in
What's the point on different machines to edit the same thing?
Normal pull workflow, made changes, committed, push. On another machine, pull, make changes, commit, push. Profit!
> Normal pull workflow, made changes, committed, push. On another machine, pull, make changes, commit, push. Profit!
This is if there is always internet. Often there is no way to commit due to the lack of a network, power is often cut off and you stomp home from work without committing. There are many different situations. Plus, on a mobile device, I forgot to pay for the Internet. You never know.
For Git, there is no concept of a "later commit", for it all commits made from the same ancestor are parallel.
In your generic team, you create a commit and then, during pull, ask to resolve conflicts automatically using the changes from the remote branch, that is, you resolve conflicts in favor of the changes you made earlier. Which, I think, is a little counter to the desire to use the most recent changes made.
Perhaps ours strategy is more suitable for you.
In this case, no merge is performed, the pointer is simply thrown to the last local commit. All deleted change history is ignored.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question