When remote connection is not possible, you can put a Git repo on a stick. But how do you merge without getting so many conflicts?
Why would you get so many conflicts? Well, since they are the same files, and you are changing them in local and remote, you will probably change the same lines. Or my present Git understanding is missing something, like a force option?
If you don’t care about branching and all that, just use file synchronization tools.
Here is an example session where the USB stick contains a Git repo:
git fetch path-to-repo-on-stick git merge -s recursive -Xtheirs --no-commit FETCH_HEAD ... now inspect, test, etc. ... git commit
1. Get fetch will get the new stuff from the “remote” repo that is on the USB stick.
2. Now we want to merge this into the local repo.
-s recursive is the strategy.
-X gives the option to the strategy
–no-commit we want to inspect and test before we actually merge.
FETCH_HEAD is where the new stuff gets placed (the commit object?)
4. We visually inspect and run tests here. Nothing broke?
6. Commit the changes in the working set, that was created at 2.
Posted by a Git newbie, so “be careful out there”.
The git-bundle command is the standard way of doing this. Find out how to use it: Git’s Little Bundle of Joy.
Does using bundling remove the excess conflicts?
- Git’s Little Bundle of Joy
- git: fetch and merge, don’t pull
- Guerilla Version Control
- Using GIT on USB stick for “travelling code”
- Version control on a 2GB USB drive
- Using Git DVC in conjuntion with a legacy SCM tool
- Synchronize git repositories between deskop and laptop
- The sneakernet in git