git branch -set-upstream-to origin/master master Step 9 - Push to my forkĪnd now I can push to my forked repo and create a PR. Or if it's an older repo with master instead of main as the default branch. git branch -set-upstream-to origin/main main Set the upstream of my main branch to point to my fork. Or via HTTPS: git remote add origin remote add using https Step 7 - Fetch from my new origin git fetch origin Step 8 - Set origin main (or master) Now I can just point origin at my newly forked repo via SSH: git remote add origin :adam7/winget-pkgs remote add using ssh git remote rename origin upstream Step 6 - Make my fork the origin I'm going to want my fork to be origin so I can push there so let's rename the current origin. OS version: macOS 10.12.3 (16D32) Steps to Reproduce. However, there is no way to fetch changes from the parent, because no remote is added for the parent. So off to GitHub and hit the Fork button which gives me a forked repo at Step 5 - Rename my origin repo to upstream Currently, cloning a forked repository adds an origin remote linking to the fork on GitHub. Step 3 - Realise I should have forked firstĪt this point I remember I have no permissions on this repo, and I should have started from a fork □♂️ Step 4 - Fork I updated the version of QuickLook and was ready to push and create a PR when. I want to keep a fork on github up-to-date with the upstream but still allow clear tracking of changes unique to the fork. There are 3 git repositories involved here: upstream, origin, local. Most recently I thought I'd have a look at how to contribute to the new winget package manager. Now you need to sync your local git repo with the upstream version. You can select one commit or select multiple. Configuring Git to sync your fork with the upstream repository. You can select one commit or select multiple commits using Command or Shift. Select the commit you would like to cherry-pick. At that point I always wish I could remember the steps to switch to a fork, so for the benefit of my future self this time I wrote down the steps. In the list of branches, click the branch that has the commit that you want to cherry-pick. I often clone a repo on GitHub or GitLab make some changes to it locally and then think I'd like to contribute my changes back to the repo.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |