Clone existing git over new Repo

It is good for us to start from something existing or build on top of existing repo if there is any similar to what we’re looking for rather than build from sketch. I know we can easily to download existing source and directly git add . to you brand new repo. But this will lost all commit history from original author. Usually that is good practice also to remain all the commits history from the day 1. By adding new remote then force push basically this can remain all the previous history.

git clone repo.git
git remote add openshift repo2.git
...
git commit -a -m "message"
...
git push
git push openshift master --force
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s