A long time ago I forked a repository and now have my forked repository at /myname/forkedrepo I have since made 6 different versions of this repo locally and changed/moved the files around without doing any commits to git or interacting with it all.
I am simply trying to upload the 6 different versions as branches (if this is the best way to do so) so that they are all under my forked repo.
I'm not sure if my local project folders are even connected to this original repository so I'm not sure if I can even add branches via terminal.
Do I need to connect these different version folders to the original repo somehow and then add the branches?
CodePudding user response:
Do I need to connect these different version folders to the original repo somehow and then add the branches?
Strictly speaking, no. It is sufficient that you have write access to the repository.
In each of the forks, you can submit a command similar to the following:
git push https://server.somewhere/path/to/project.git HEAD:branche-name
and then branch-name
should appear in the specified (upstream) as a new branch. Obviously, you should choose different branch names for each fork.
The command assumes that you want to upload (push) the currently checked-out branch. If you want to push a different branch, just replace HEAD
by the branch name you want to push.