Reputation: 13545
I am still a Git learner so this definitely is a beginner's error.
I cloned a repository from GitHub, created my own branch with the assmption that I can push the new branch back to GitHub. Then, I developed a feature, only to discover that I cannot sync back to GitHub, because I would have needed to fork the repository first.
Now I have created a fork. However, how can I merge my local commits that cannot be synced to GitHub with my fork? Is there an easy way or do I need to copy the changes (there are many files involved) manually?
Upvotes: 0
Views: 35
Reputation: 130
Your clone is tied to the original github repository only by the remote address
If you change the remote from the old repository to your new one, you can push your new branch as normal
From the github help pages
git remote set-url origin https://github.com/USERNAME/OTHERREPOSITORY.git
Then when you push and pull it will come to and from your new repository
Upvotes: 2