Re: Please provide a one-liner for syncing with the original/source project
From: Pratyush Yadav <hidden>
Date: 2019-11-18 10:59:38
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