![]() ![]() ![]() Is it a trivial change that he can stash away and pop it back? Is it a too complex beast that may interfere with what others are doing, or So, regarding a classic pull-merge, it is better to:Įncourage the user to think about the nature of WIP he has in the working tree before running " git pull". Loosening that may be a more productive fix to the real problem. Insists you to start from a clean working tree, so "download and ![]() The equation is somewhat different for "pull-rebase", as "rebase" In simple cases it may not hurt, but when local changes are complex, it would actively hurt than not having it, and the configuration robs the incentive to choose. I suspect that tostash configuration is not a good addition because it encourages a bad, pain-inducing workflow. The merge touched and it is likely not result in "Dropped" but leave With the merge, and this internal "stash pop" will touch the paths That triggered this topic, by definition, the local change overlaps If the pull-merge were something that would induce the "annoyance" Junio C Hamano (Git maintainer) noted that: The original thread discussing this autostash feature, it was implemented originally both for git pull (merge) and git pull -rebase.īut. So there is no automatic switch for that? Or I am missing something? I prefer doing git pull -rebase but OP asked about " standard" git pull So everybody is writing about autostash when you do rebase (or pull -rebase).īut no one is taking about autostashing when you do normal pull with merges. Update: Mariusz Pawelski asks in the comments an interesting question: This was due to a shortcut to avoid running rebase when we can fast-forward,īut autostash is ignored on that codepath. When git pull -rebase -autostash in a dirty repository resulted in aįast-forward, nothing was being autostashed and the pull failed. (Merged by Junio C Hamano - gitster - in commit 35898ea, ) pull: ff -rebase -autostash works in dirty repo See commit f15e7cf () by Tyler Brazier ( tylerbrazier). Warning: before Git 2.14 (Q3 2017), " git pull -rebase -autostash" didn't auto-stash when the local history fast-forwards to the upstream. The option to underlying " git rebase" when " git pull -rebase" is called. Understands the -autostash option, it's just a matter of passing Overrides the current value of toStash, if set. Teach " git pull -rebase" the -autostash command line flag which Override it for " git pull -rebase" from the command line. If toStash configuration variable is set, there is no way to ![]() (Merged by Junio C Hamano - gitster - in commit 7c137bb, )Ĭommit f66398e in particular includes: pull -rebase: add -autostash flag See commit 450dd1d, commit 1662297, commit 44a59ff, commit 5c82bcd, commit 6ddc97c, commit eff960b, commit efa195d (), and commit f66398e, commit c48d73b () by Mehul Jain ( mehul2029). Note: if you want to pull without autostash (even though toStash true is set), you have since git 2.9 (June 2016): pull -rebase -no-autostash Only verify if the working tree is dirty when tostash is not Rebase learned to stash changes when it encounters a dirty work tree, (Merged by Junio C Hamano - gitster - in commit e69b408, ) pull: allow dirty tree when tostash enabled See commit 53c76dc () by Kevin Daudt ( Ikke). That would be enough for a simple git pull to work even in a dirty tree. In a given repository: git config pull.rebase true When true, rebase branches on top of the fetched branch, instead of merging the default branch from the default remote when "git pull" is run. However, use with care: the final stash application after a successful rebase might result in non-trivial conflicts. This means that you can run rebase on a dirty worktree. When set to true, automatically create a temporary stash before the operation begins, and apply it after the operation ends. (with Git 2.27, Q2 2020, you now also have tostash, see below) The only git config setting which would be of interest is: tostash ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |