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

2 messages from 2019-11-17 to 2019-11-18. Participants: Jeffrey Walton, Pratyush Yadav.
Thread: https://gitlist.dev/t/52281

## Jeffrey Walton, 2019-11-17 20:56

Subject: Please provide a one-liner for syncing with the original/source project
Message-ID: <CAH8yC8m45JGwjd-vRaE-05=MmDHq4qxWBh-wtsK09xuW+mp3mg@mail.gmail.com>
URL: https://gitlist.dev/e/CAH8yC8m45JGwjd-vRaE-05%3DMmDHq4qxWBh-wtsK09xuW%2Bmp3mg%40mail.gmail.com

```
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).

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.

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.

```

## Pratyush Yadav, 2019-11-18 10:59

Subject: Re: Please provide a one-liner for syncing with the original/source project
Message-ID: <20191118105931.kslaxyniesbzjauo@yadavpratyush.com>
URL: https://gitlist.dev/e/20191118105931.kslaxyniesbzjauo%40yadavpratyush.com
In-Reply-To: <CAH8yC8m45JGwjd-vRaE-05=MmDHq4qxWBh-wtsK09xuW+mp3mg@mail.gmail.com>

```
On 17/11/19 03:56PM, Jeffrey Walton wrote:
> 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.
 
> 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?
 
> 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

```
