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.git
  • main 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:

  1. clone new local repo of remote repo wish fork:

    git clone [source url] source_repo

  2. change created directory (source_repo).

  3. for every branch wish fork, do:

    git branch --track [branch name]

  4. add new remote repository:

    git remote add [dest repo name] [dest repo url]

  5. now push branches forked repository:

    git push --all [dest repo name]

answer derived this.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -