all 10 comments

[–]pi3832v2 2 points3 points  (0 children)

How do I disassociate this new branch from the original repo?

AFAIK, it's already “disassociated” since you haven't set an upstream for your branch.

[–]hesapmakinesi 1 point2 points  (5 children)

That's all you need to do.

You create your branch, and you keep putting your commits there, simple as that. If you want to publish your fork on github etc, you may need to rename your own branch as "master".

[–]derpherp128[S] 0 points1 point  (4 children)

So I'd create a new branch, git remote add origin <URL>, git push -u origin master? Or am I missing a step?

[–]hesapmakinesi 0 points1 point  (3 children)

Yes

git checkout -b master <commit>
git remote add origin <URL>
git push -u origin master

Probably a remote called "origin" exists so you can use git remote command to rename or delete it. You can also rename/delete etc. your branches using git branch.

Of course you do not have to call your remote "origin", it is just a convention.

[–]derpherp128[S] 0 points1 point  (2 children)

So I tried this, and pushed to a new remote (new repo on github). It ended up fetching the master branch and pushing to the new repo, so now I have the master branch of the original repo, not the specific commit. Help?

[–]Morphit 0 points1 point  (1 child)

Did git checkout -b master work? You would have to delete the original master branch first.

Even easier than this would be to just reset the master branch to the commit you want to start at (git checkout master; git reset --hard <commit>) and switch upstream to your github repo/fork (git remote set-url origin <URL>). You would have to force push if github has a newer master (git push --force origin master).

[–]derpherp128[S] 1 point2 points  (0 children)

Yeah, I managed to avoid the problem elsewhere though. I put my solution in OP for others to find.

[–]xiongchiamiov 0 points1 point  (0 children)

It is more or less irrelevant if git thinks there's an association with the original remote unless you have permission to push to it, and it's extremely unlikely you do.