1

I need to duplicate a repository without forking it since I will not make any PR to the parent repository. So I have found this docs from Github and I follow the steps in there.

The original repository is docker-nginx-php and I have created the duplicated in my account under another-lamp-docker

What I expect to see is just a duplicate of the repository but without any reference to previous commits, contributors, authors, etc and yes, I am not stolen this work, I will people know on the README that the new work is based on this original repository.

As a result I am seeing the following behavior:

  • The image below shown the main screen of the duplicated repository:

enter image description here

  • The image below shown the branches tab, showing up the 4 branch from the original repository but showing also kind of dependencies.

enter image description here

  • Even on the contributors tab I am seeing old owners

enter image description here

  • Is that the expected behavior from duplicating a repository?
  • Can I get rid of all that history (I believe this is what it's) information?
  • If so how?
ReynierPM
  • 17,594
  • 53
  • 193
  • 363

2 Answers2

2

If you really want to remove all the past history:

  • Clone the repository.
  • Remove the .git directory (rm -rf .git)
  • Initialize a new git repository (git init)
  • Commit all the files (git add .; git commit -m 'Initial commit')
  • Create your target repository on GitHub
  • Configure the github repository as a remote (git remote add origin git@github.com:...)
  • Push your local repository to GitHub (git push -u origin master)

Now you have all the files from the original repository without any of the history.

While that will work, I think this is generally a bad idea. If you're going to fork an existing project, why not just do that via the existing "fork" mechanism? What are you trying to avoid by eliminating the contribution history of the existing project? This will make it more difficult for you to merge changes and bug fixes from the original repository (and of course will make it more difficult for you to contribute changes back if you fix something that might be of general interest).

larsks
  • 277,717
  • 41
  • 399
  • 399
  • I am not contributing at all to the existing repository because I will remove some stuff that they need so a fork isn't an option. I have to ask them if they prefer to keep a cleanest version on a new branch and if so then fork is the way to go, otherwise I need to duplicate they work and start mine based on that – ReynierPM Nov 17 '16 at 14:32
0

I'd suggest just downloading the zip file and converting it to a git repo. You can then set your remote url and push to the new repo. You shouldn't have any of the history or previous owner showing up in GitHub

  1. Download Zip
  2. cd in project directory and convert project folder to local Git repo with git init
  3. Add project files to staging area with git add .
  4. Set your remote git url with git remote add origin <url>
  5. Commit locally with git commit -m 'message'
  6. Push to remote with git push -u origin master
Jake Henningsgaard
  • 704
  • 1
  • 6
  • 16