简体   繁体   中英

Contributors in GitHub Repo

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?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM