我通过拖动链接将Git从GitHub克隆到我的桌面。
但是,文件夹名称是不需要的长号码。
如何重命名文件夹,仍然可以继续将该文件夹中的更新提交到GitHub上的Gist?
有可能吗?
答案 0 :(得分:6)
只需重命名文件夹即可! git
不关心文件夹的名称,只需要在其中有一个.git
- 文件夹。 1 您甚至可以提供要克隆的文件夹的名称到git clone的第二个参数:
git clone repository name-of-folder
另请参阅此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
作为参考,这是要点:https://gist.github.com/TimWolla/9028551