Home > Mobile >  Contributors in GitHub Repo
Contributors in GitHub Repo

Time:12-30

I cloned the code from a repository to get some inspiration for my own work.

Now after I have made many changes, I would like to push in another repository of my own.

I tried to do this but I see two contributors, me and the owner of the cloned repo.
Can someone help me to get a repository with only one contributor (me), since the new repository intent will have little to do with the initial repository?

CodePudding user response:

Another approach would be to:

  • clone again the original repository, in a new local folder

  • delete the .git/ subfolder

  • initializing and adding (under your user.name) the initial codebase

    git init .
    git add .
    git commit -m "Initial import from codebase https://github.com/x/y"
    
  • replaying the commits you have done locally during your extensive modification of the first cloned repository (the one where you see external contributor to what is, essentially, a new project from an old codebase)

    git remote add firstRepo ../firstClonedFolder
    git fetch firstRepo
    git switch main
    git rebase --onto main firstRepo/main~10 firstRepo/main
    

Replace 10 by the number of commits you have done.

Delete your GitHub repository and recreate it empty: you can push to it your new local repository, which will have only your own commits.

git remote add origin https://github.com/me/myNewEmptyRepo
git push -u origin main

Don't forget to add in the README.md a clear reference to the original repository from which you get your inspiration, as well as a link to their author.

  • Related