Push all git comits as one to empty bare repo -


i have 2 bare repositories.

repo1 - history
repo2 - new, empty one

i want push files repo1 repo2, without whole history, the state last commit.

i don't want touch history of repo1 (it's best assume it's read only). in new repo don't want have history (including reflogs), shashing after push not option.

is ever possible without creating new, temporary repository?
how can achieve this?

do following:

git checkout --orphan temp_branch git commit -m "initial commit" git push repo2 temp_branch:master 

this create temp_branch locally single commit current snapshot, , push branch called "master" on repo2.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -