0

I may have messed up my workflow with github - I noticed some issues with a repo and wanted to fix them. I cloned the repo (Github Desktop, Mac OS) and made the changes in XCode, I created a local branch to the repo after making the changes and committed the changes. I then tried to push the changes but had an error related to permissions.

I went to the github repo and forked it, now I have the fork in my github account and the local branch. I can't figure out how to merge my local branch changes into the fork without overwriting them (no changes made to the fork).

1 Answer 1

1

You'll need to:

  1. Add a new remote repository pointing to your fork
  2. Push your local changes to your remote fork

To add the new remote you'll have to type this in your repository folder:

git remote add myfork {GIT_URL_OF_YOUR_FORK}

After this you simply need to push your branch to your fork

git push myfork {BRANCH_NAME_THAT_HAS_THE_LOCAL_CHANGES}

This should be about it.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you - I was able to make this work and the changes show up in the branch when done from the command line, but I still have an issue doing a publish from xcode or github desktop - it attempts to publish to the master repo. Is there a setting to specify the branch as the preferred target?
It doesn't seem you can add a remote, but can change the existing one: help.github.com/desktop/guides/contributing/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.