delorie.com/archives/browse.cgi | search |
DJ Delorie wrote: > > What do you want? > > I want "git update" to do what "cvs update" and "svn update" does - > update the source tree under my work-in-progress. I think this: git config --global alias.update \ '!git stash -a && git pull --rebase && git stash pop --index' might do what you want. The only gotcha is that if your WIP stash conflicts with what you've pulled, the stash will not get dropped. You can just leave it sitting there, it doesn't matter too much. If you don't mind losing track of what was git add:ed then another idea is: git config --global alias.update \ '!f=$(mktemp) && git diff HEAD > "$f" && git reset --hard && \ git pull --rebase && git apply "$f" && rm "$f"' although much more clumsy, it could also do the trick. This complexity is only needed if creating a few temporary commits must always be avoided at all cost. It would be much simpler to create temporary commits with the WIP and turn them into a single proper commit in the end, when the work is finished. Then: git config --global alias.update 'pull --rebase' //Peter
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |