I am working on a project with multiple developers on different branches, which exists on let's say: "...github.com/owner/project".
There is the usual "master", "me", and several "other" branches.
I would like to create a new github repo and push my local copy there. However, when I create a new github repo, add remote, and push, a much older version gets pushed instead of the latest local copy.
I searched around and saw answers about "detached heads" and similar terms that I'm not too familiar with. I'm not an expert on git either, so I guess the best thing I can do is to post the steps I followed and the configuration options.
Create new github repo called "project_copy" from github account ... cd to local repo ... git remote add project_copy ...github.com/me/project_copy.git git config --list (a part is shown below): remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* remote.origin.url=...github.com/owner/project remote.project_copy.url=...github.com/me/project_copy.git remote.project_copy.fetch=+refs/heads/*:refs/remotes/project_copy/* git push project_copy master
This is the output I get:
To ...github.com/me/project_copy.git * [new branch] master -> master Branch master set up to track remote branch master from project_copy.
Normally I would use the following to push changes to my branch:
git push origin me