How to use a GitHub project as the basis for a new one?

6

I'm trying to use the angular-phonecat project as the basis for a new project, and make modifications on top of it, because the structure is very similar to what I want to develop and so I would not have to configure and download everything I need (npm, bower). But whenever I create a new repository, it looks like a copy of the original repository and I can not commit my modifications to my project. What I'm doing:

  • Angle-phonecat project fork
  • Clone of my fork
  • I create a new repository in GitHub
  • I change the origin: git remote set-url origin git://github.com/meu-repositorio-criado
  • git fetch --prune (I searched that deletes the branches, but it did not work for what I want)
  • git push

After the push, the project of the new repository is the same as the angular-phonecat origial and I can not send my commits. What to do? I want my project to be independent, only with the 'skeleton' of the other.

    
asked by anonymous 07.06.2016 / 18:13

1 answer

3

Do the following.

Clone the project and then delete the .git folder so that it does not hold the Git information after it has been cloned:

git clone https://github.com/camilaavilarinho/angular-phonecat.git [nome-do-projeto] && rm -rf [nome-do-projeto]/.git

Create a repository for this new repository in Github. And then, tell your project which path to the remote repository (the one you just created):

git remote add origin [novo-caminho-do-projeto]

After that, just edit and upload the changes, you will not change the original project any more.

    
07.06.2016 / 21:34