AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Git set upstream for fork9/12/2023 This allowed me to change the origin associated with my local clone of the upstream repo, essentially setting the origin to my fork. My primary question involved how to change the origin repo, which is possible with git remote set-url origin. Resetting the fork so that it was in sync with the upstream repo was straightforward enough. This should be something simple like adding a new remote origin correct? Something like git remote add origin ? If I do that, how can I commit and push to my fork? So if people make changes to the original repository, itll show up in my Sourcetree and Ill know to pull from upstream/develop to local/develop. Now I just need to push the changes I've made to my clone of the upstream repo to my fork. For example Sourcetree is set up so that local/develop tracks the remote branch upstream/develop, while pushing to the remote branch origin/develop. I've reset my fork to match the upstream repo. underscored at 11:12 Correct solution to my problem is git push upstream master:, where master refers to the branch name in my fork and is the branch name on the original upstream repository.I'm making another backup currently before I try any commands, because I cannot lose these changes. you of course don't want to mention origin if you're trying to push to upstream. I apologize for not providing additional details and commands I've tried so far. But since I've already reapplied thousands of lines of changes over many files I would like to avoid doing that again. git push -u Alternatively, you can use the set-upstream option that is equivalent to the -u option.
0 Comments
Read More
Leave a Reply. |