简体   繁体   中英

Can I completely swap out a Github repository?

Github enriches your repository with wiki pages, issues, starring and so on. Since I rewrote one of my applications, I'd like to use this fresh repository from now on while keeping the things around. I thought about removing all current remote branches except the master and force pushing the master of the new repository.

Would this remove the old commits from the remote? Are there any troubles I'd run into with this?

Would this remove the old commits from the remote?

Any other commits not accessible from the master branch (that you are pushing) would still be there: pushing master alone does not remove the other branches at the remote repo, even if you have removed them in your local repo .

You need to push the deletion of those branches as well:

git push origin --delete branch

(assuming ' origin ' is the name of the remote referencing your GitHub repo)

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