From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Mathias Kunter <mathiaskunter@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: Default behavior of git pull
Date: Mon, 31 May 2021 18:27:01 +0700 [thread overview]
Message-ID: <92682abb-3062-4613-399d-a3279afb8f0b@gmail.com> (raw)
In-Reply-To: <7a97ac78-f405-2dca-2998-f03637cc8255@gmail.com>
Hi Mathias,
On 31/05/21 16.18, Mathias Kunter wrote:
> Wouldn't it make sense if "git pull" would by default also pull the
> branch with the same name from the remote, in case no upstream is
> configured?
>
> If I can push to a remote with a simple "git push", then I'd also expect
> to be able to pull from that same remote with a simple "git pull".
>
> Does anything speak against this?
>
> Example:
>
> git clone $url
> git checkout -b fix-1
> # do commits
> git push # push to origin/fix-1 (works)
> git push origin # push to origin/fix-1 (works)
> # other people push to origin/fix-1
> git pull # pull from origin/fix-1 (fails)
> git pull origin # pull from origin/fix-1 (fails)
IME, I did git fetch first before I did git pull, unless I have repos
that I didn't intentionally want to contribute to (just collecting
them). When I choose to work, I always create a branch, then submit
PR/patches from that against mainline.
Since you do centralized workflow like above, I advise you to integrate
from remote with git fetch + git merge.
And you asked whether plain git pull can work. It is yes, provided that
you don't do any local work on remote-tracking branches (such as
mainline or hotfixes).
--
An old man doll... just what I always wanted! - Clara
next prev parent reply other threads:[~2021-05-31 11:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-31 9:18 Default behavior of git pull Mathias Kunter
2021-05-31 11:27 ` Bagas Sanjaya [this message]
2021-05-31 13:03 ` Mathias Kunter
2021-07-14 15:31 ` Felipe Contreras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=92682abb-3062-4613-399d-a3279afb8f0b@gmail.com \
--to=bagasdotme@gmail.com \
--cc=git@vger.kernel.org \
--cc=mathiaskunter@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.