You can, but then your https://github.com/usrname/test.git won't be a fork.
Just a regular cloned repo, without any special relationship with the original repo https://github.com/octocat/Spoon-Knife.
- git clone your fork
- make a local branch for any remote branch you have fetch with that clone: see the details in "Track all remote git branches as local branches"
- add
test.git
as a remote to your local clone, named 'test
'
- push everything back to test.git
That would be:
git clone https://github.com/usrname/Spoon-Knife.git
cd Spoon-Knife
git fetch --tags
remote=origin ; for brname in `git branch -r | grep $remote | grep -v master | grep -v HEAD | awk '{gsub(/[^\/]+\//,"",$1); print $1}'`; do git branch --set-upstream-to $brname $remote/$brname ; done
git remote add test https://github.com/usrname/test.git
git config push.default matching
git push --all
git push --tags
git config push.default simple
For the push policies (the config push.default
part), see "What is the result of git push origin
?".