git - Create a developer fork of non-Github repository -
i'd create developer fork (not checkout) of non-github repository. setup:
main
repository on machine x in /export/git/foo.gitmain
repository has many branches.- new bare repository created in /home/me/fork.git on machine x.
- want bring not branches
main
repository new repository. bring on branch histories new repository. - want able bring new commits
main
new repository.
bonus points spelling out how push commits new repository main
without using patches.
i searched site , internet did not see use case solved. git commands needed above?
machine x linux box.
here steps:
clone new local repo of remote repo wish fork:
git clone [source url] source_repo
change created directory (source_repo).
for every branch wish fork, do:
git branch --track [branch name]
add new remote repository:
git remote add [dest repo name] [dest repo url]
now push branches forked repository:
git push --all [dest repo name]
answer derived this.