我有這個需要。我想創建一個現有網站的精確副本,並將其放在一個子域中作為存檔。
現在,此網站處於版本控制之下,我想保留吉特歷史,但也將其部署到新的GitHub存儲庫中,因此我可以將其單獨部署,現在兩個站點都可以按自己的命運進行。
該網站是Hugo網站,因此我只是將網站文件夾複製到一個單獨的文件夾中,也就是本地。
因此,我進入了終端中的複制站點文件夾,然後我運行了
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