Why avoid `git pull` and what to do instead

Multi tool use
In this comment,
@torek (reputation currently 172,509) said:
I actually recommend avoiding
git pull
entirely, for the same reason you recommend avoiding--autostash
The reason given for avoiding git rebase --autostash
was:
It seems convenient when it works but is problematic when it doesn't
In which ways can git pull
be problematic when it doesn't work?
My robust automated solution to avoiding git pull --autostash
is non-trivial.
Is there a robust automated solution to avoiding git pull
?
git git-merge git-pull pull git-fetch
|
show 2 more comments
In this comment,
@torek (reputation currently 172,509) said:
I actually recommend avoiding
git pull
entirely, for the same reason you recommend avoiding--autostash
The reason given for avoiding git rebase --autostash
was:
It seems convenient when it works but is problematic when it doesn't
In which ways can git pull
be problematic when it doesn't work?
My robust automated solution to avoiding git pull --autostash
is non-trivial.
Is there a robust automated solution to avoiding git pull
?
git git-merge git-pull pull git-fetch
1
What doespull
have to do withrebase --autostash
? Also, remember a pull is just a fetch then a merge.
– evolutionxbox
Oct 18 '18 at 8:41
@evolutionxbox presumably it's a series of commands (stash push, rebase, stash pop / fetch merge) which can lose information (eg exit status). See the links for more context.
– Tom Hale
Oct 18 '18 at 9:17
2
"Robust" tends to be hard. Since pull = fetch + 2nd-git-command, rungit fetch
(which is pretty safe at all times assuming standard configurations), then build the robust part around whichever second command you want.
– torek
Oct 18 '18 at 15:28
1
Possibly relevant: adamcod.es/2014/12/10/git-pull-correct-workflow.html
– chevybow
Oct 18 '18 at 15:42
@chevybow Excellent, that was the answer I was after. Thanks!
– Tom Hale
Oct 19 '18 at 12:35
|
show 2 more comments
In this comment,
@torek (reputation currently 172,509) said:
I actually recommend avoiding
git pull
entirely, for the same reason you recommend avoiding--autostash
The reason given for avoiding git rebase --autostash
was:
It seems convenient when it works but is problematic when it doesn't
In which ways can git pull
be problematic when it doesn't work?
My robust automated solution to avoiding git pull --autostash
is non-trivial.
Is there a robust automated solution to avoiding git pull
?
git git-merge git-pull pull git-fetch
In this comment,
@torek (reputation currently 172,509) said:
I actually recommend avoiding
git pull
entirely, for the same reason you recommend avoiding--autostash
The reason given for avoiding git rebase --autostash
was:
It seems convenient when it works but is problematic when it doesn't
In which ways can git pull
be problematic when it doesn't work?
My robust automated solution to avoiding git pull --autostash
is non-trivial.
Is there a robust automated solution to avoiding git pull
?
git git-merge git-pull pull git-fetch
git git-merge git-pull pull git-fetch
asked Oct 18 '18 at 8:39


Tom HaleTom Hale
6,7064156
6,7064156
1
What doespull
have to do withrebase --autostash
? Also, remember a pull is just a fetch then a merge.
– evolutionxbox
Oct 18 '18 at 8:41
@evolutionxbox presumably it's a series of commands (stash push, rebase, stash pop / fetch merge) which can lose information (eg exit status). See the links for more context.
– Tom Hale
Oct 18 '18 at 9:17
2
"Robust" tends to be hard. Since pull = fetch + 2nd-git-command, rungit fetch
(which is pretty safe at all times assuming standard configurations), then build the robust part around whichever second command you want.
– torek
Oct 18 '18 at 15:28
1
Possibly relevant: adamcod.es/2014/12/10/git-pull-correct-workflow.html
– chevybow
Oct 18 '18 at 15:42
@chevybow Excellent, that was the answer I was after. Thanks!
– Tom Hale
Oct 19 '18 at 12:35
|
show 2 more comments
1
What doespull
have to do withrebase --autostash
? Also, remember a pull is just a fetch then a merge.
– evolutionxbox
Oct 18 '18 at 8:41
@evolutionxbox presumably it's a series of commands (stash push, rebase, stash pop / fetch merge) which can lose information (eg exit status). See the links for more context.
– Tom Hale
Oct 18 '18 at 9:17
2
"Robust" tends to be hard. Since pull = fetch + 2nd-git-command, rungit fetch
(which is pretty safe at all times assuming standard configurations), then build the robust part around whichever second command you want.
– torek
Oct 18 '18 at 15:28
1
Possibly relevant: adamcod.es/2014/12/10/git-pull-correct-workflow.html
– chevybow
Oct 18 '18 at 15:42
@chevybow Excellent, that was the answer I was after. Thanks!
– Tom Hale
Oct 19 '18 at 12:35
1
1
What does
pull
have to do with rebase --autostash
? Also, remember a pull is just a fetch then a merge.– evolutionxbox
Oct 18 '18 at 8:41
What does
pull
have to do with rebase --autostash
? Also, remember a pull is just a fetch then a merge.– evolutionxbox
Oct 18 '18 at 8:41
@evolutionxbox presumably it's a series of commands (stash push, rebase, stash pop / fetch merge) which can lose information (eg exit status). See the links for more context.
– Tom Hale
Oct 18 '18 at 9:17
@evolutionxbox presumably it's a series of commands (stash push, rebase, stash pop / fetch merge) which can lose information (eg exit status). See the links for more context.
– Tom Hale
Oct 18 '18 at 9:17
2
2
"Robust" tends to be hard. Since pull = fetch + 2nd-git-command, run
git fetch
(which is pretty safe at all times assuming standard configurations), then build the robust part around whichever second command you want.– torek
Oct 18 '18 at 15:28
"Robust" tends to be hard. Since pull = fetch + 2nd-git-command, run
git fetch
(which is pretty safe at all times assuming standard configurations), then build the robust part around whichever second command you want.– torek
Oct 18 '18 at 15:28
1
1
Possibly relevant: adamcod.es/2014/12/10/git-pull-correct-workflow.html
– chevybow
Oct 18 '18 at 15:42
Possibly relevant: adamcod.es/2014/12/10/git-pull-correct-workflow.html
– chevybow
Oct 18 '18 at 15:42
@chevybow Excellent, that was the answer I was after. Thanks!
– Tom Hale
Oct 19 '18 at 12:35
@chevybow Excellent, that was the answer I was after. Thanks!
– Tom Hale
Oct 19 '18 at 12:35
|
show 2 more comments
1 Answer
1
active
oldest
votes
No need for avoiding git pull: since Git 2.9, type:
git config --global pull.rebase true
git config --global rebase.autoStash true
Then a simple git pull
will do, in essence, what your better workflow is about: rebase if needed your current branch on top of the fetched origin/yourBranch
.
One reason to avoid doing this is given here, namely a0
exit status even though the stash failed to reapply.
– Tom Hale
Dec 29 '18 at 23:14
@TomHale I agree, and have upvoted your script. I simply have not been confronted to that issue often enough.
– VonC
Dec 30 '18 at 7:55
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52870122%2fwhy-avoid-git-pull-and-what-to-do-instead%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
No need for avoiding git pull: since Git 2.9, type:
git config --global pull.rebase true
git config --global rebase.autoStash true
Then a simple git pull
will do, in essence, what your better workflow is about: rebase if needed your current branch on top of the fetched origin/yourBranch
.
One reason to avoid doing this is given here, namely a0
exit status even though the stash failed to reapply.
– Tom Hale
Dec 29 '18 at 23:14
@TomHale I agree, and have upvoted your script. I simply have not been confronted to that issue often enough.
– VonC
Dec 30 '18 at 7:55
add a comment |
No need for avoiding git pull: since Git 2.9, type:
git config --global pull.rebase true
git config --global rebase.autoStash true
Then a simple git pull
will do, in essence, what your better workflow is about: rebase if needed your current branch on top of the fetched origin/yourBranch
.
One reason to avoid doing this is given here, namely a0
exit status even though the stash failed to reapply.
– Tom Hale
Dec 29 '18 at 23:14
@TomHale I agree, and have upvoted your script. I simply have not been confronted to that issue often enough.
– VonC
Dec 30 '18 at 7:55
add a comment |
No need for avoiding git pull: since Git 2.9, type:
git config --global pull.rebase true
git config --global rebase.autoStash true
Then a simple git pull
will do, in essence, what your better workflow is about: rebase if needed your current branch on top of the fetched origin/yourBranch
.
No need for avoiding git pull: since Git 2.9, type:
git config --global pull.rebase true
git config --global rebase.autoStash true
Then a simple git pull
will do, in essence, what your better workflow is about: rebase if needed your current branch on top of the fetched origin/yourBranch
.
answered Dec 28 '18 at 21:29
VonCVonC
834k29026263170
834k29026263170
One reason to avoid doing this is given here, namely a0
exit status even though the stash failed to reapply.
– Tom Hale
Dec 29 '18 at 23:14
@TomHale I agree, and have upvoted your script. I simply have not been confronted to that issue often enough.
– VonC
Dec 30 '18 at 7:55
add a comment |
One reason to avoid doing this is given here, namely a0
exit status even though the stash failed to reapply.
– Tom Hale
Dec 29 '18 at 23:14
@TomHale I agree, and have upvoted your script. I simply have not been confronted to that issue often enough.
– VonC
Dec 30 '18 at 7:55
One reason to avoid doing this is given here, namely a
0
exit status even though the stash failed to reapply.– Tom Hale
Dec 29 '18 at 23:14
One reason to avoid doing this is given here, namely a
0
exit status even though the stash failed to reapply.– Tom Hale
Dec 29 '18 at 23:14
@TomHale I agree, and have upvoted your script. I simply have not been confronted to that issue often enough.
– VonC
Dec 30 '18 at 7:55
@TomHale I agree, and have upvoted your script. I simply have not been confronted to that issue often enough.
– VonC
Dec 30 '18 at 7:55
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52870122%2fwhy-avoid-git-pull-and-what-to-do-instead%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
5dAQMlNoK Bwk84p5OqepIMtv83uAsBHOOOOQ65w2W3Fd85,KzEvRIXgXvw3QLSUMeoc,7,RIUA btVviX52bSZmhwQjKpwNl9 4XEO6
1
What does
pull
have to do withrebase --autostash
? Also, remember a pull is just a fetch then a merge.– evolutionxbox
Oct 18 '18 at 8:41
@evolutionxbox presumably it's a series of commands (stash push, rebase, stash pop / fetch merge) which can lose information (eg exit status). See the links for more context.
– Tom Hale
Oct 18 '18 at 9:17
2
"Robust" tends to be hard. Since pull = fetch + 2nd-git-command, run
git fetch
(which is pretty safe at all times assuming standard configurations), then build the robust part around whichever second command you want.– torek
Oct 18 '18 at 15:28
1
Possibly relevant: adamcod.es/2014/12/10/git-pull-correct-workflow.html
– chevybow
Oct 18 '18 at 15:42
@chevybow Excellent, that was the answer I was after. Thanks!
– Tom Hale
Oct 19 '18 at 12:35