git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Please provide a one-liner for syncing with the original/source project

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Nov 18, 2019, 10:59 UTC
Message-ID
<20191118105931.kslaxyniesbzjauo@yadavpratyush.com>
In-Reply-To
<CAH8yC8m45JGwjd-vRaE-05=MmDHq4qxWBh-wtsK09xuW+mp3mg@mail.gmail.com>
On 17/11/19 03:56PM, Jeffrey Walton wrote:
Show 14 quoted lines
> Hi Everyone,
> 
> One of my common workflows is, clone a open source project like Git,
> OpenSSL, etc. Then make some changes and push my changes to my clone.
> And maybe submit a pull request to the original/source project. After
> the initial clone my project becomes out-of-sync with the project of
> interest.
> 
> I have to do something special to get my copy of the project back
> in-sync with the original/source project. It is not trivial to get
> back in sync. It takes three or four separate commands if all goes
> well. And in my case, I have to look up the instructions because they
> are not ingrained in memory (like
> https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork).
FWIW, these multiple steps can be replaced by 'git pull upstream 
master', assuming you have 'master' checked out locally.
 
Show 9 quoted lines
> This sync workflow is so common Git should be providing it. Anyone who
> has cloned from GitHub, GitLab, etc needs it. Folks should not need to
> do special things for common workflows. When sites like GitHub and
> GitLab are providing explicit instructions to sync with the
> original/source project should signal it is common and people need it.
> 
> I'd like a one-line command to resync with the original or source
> project (and not my clone). I think a 'git sync' command would be a
> good addition to the Git tools.
What would 'git sync' do that 'git pull upstream' or 'git pull --rebase 
upstream' can not do?
 
Show 5 quoted lines
> It would be nice if sites like GitHub would value add the ' upstream =
> ...' to a .git/config, but that is not Git's problem. I'll settle for
> manually adding upstream so 'git sync' just works.
> 
> Thanks in advance.
-- 
Regards,
Pratyush Yadav
Previous: Jeffrey Walton
Message 2 of 2 in “Please provide a one-liner for syncing with the original/source project”
  1. Jeffrey WaltonNov 17, 2019
  2. Pratyush YadavNov 18, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.