J'avais ce besoin. Je voulais créer une copie exacte d'un site Web existant et le mettre dans un sous-domaine, en tant qu'archive.
Maintenant, ce site est sous contrôle de version, et je voulais conserver leGithistorique, mais aussi le déployer dans un nouveau dépôt GitHub, afin que je puisse le déployer séparément, maintenant les deux sites pourraient suivre leur propre destin.
Le site Web est un site Hugo, alors je viens de copier le dossier du site Web dans un dossier séparé, et c'est tout, localement.
Alors je suis allé dans le dossier du site copié dans le terminal, et j'ai couru
git remote -vthis listed the existing GitHub repository as the “origin” remote.
I ran:
git remote rm originThis removed the origin remote, so running git remote -v
didn’t return anything any more.
Now since I use GitHub Desktop I just dragged the folder in that app, and I was able to create a new, different GitHub repository from there.
More git tutorials:
- A Git Cheat Sheet
- Git workflow to manage work on multiple branches
- An easy way to handle Git subrepositories
- An incomplete list of great Git tutorials
- A developer's introduction to GitHub
- The complete Git guide
- How to discover a bug using git bisect
- How to make your first Pull Request on GitHub
- How to update a Git branch from another branch
- I posted my password / API key on GitHub
- Squashing Git commits
- How to remove a Git remote