只需重命名文件夹即可!git不关心文件夹的名称,它只要求里面有一个文件夹.git.1您甚至可以将要克隆的文件夹的名称提供给git clone的第二个参数:
git clone repository name-of-folder
Run Code Online (Sandbox Code Playgroud)
另请参阅此shell脚本以查看git不关心名称:
[timwolla@/tmp]git clone https://gist.github.com/9028551.git
Cloning into '9028551'...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
Checking connectivity... done
[timwolla@/tmp]mv 9028551/ example-folder/
[timwolla@/tmp]cd example-folder/
[timwolla@/tmp/example-folder master]touch otherfile
[timwolla@/tmp/example-folder master]git add otherfile
[timwolla@/tmp/example-folder master]git commit -m "Add otherfile"
[master 5f80cf2] Add otherfile
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 otherfile
[timwolla@/tmp/example-folder master]git push
Username for 'https://gist.github.com': timwolla
Password for 'https://timwolla@gist.github.com':
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 289 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://gist.github.com/9028551.git
47890af..5f80cf2 master -> master
Run Code Online (Sandbox Code Playgroud)
作为参考,这是要点:https://gist.github.com/TimWolla/9028551
1 技术上甚至没有