请教:GIT create repository 方法, 谢谢!

物润声无 2013-08-30 05:35:51
创建git repository,除了在github上创建一个项目,再在local git 中clone一下,还有其他方法吗?

本地没有repository
$ git init
Initialized empty Git repository in D:/git/.git/

求方法二, 谢谢!
...全文
352 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
糊涂的小白 2013-08-30
  • 打赏
  • 举报
回复
mkdir repository cd repository git init 就已经在当前目录创建git 仓库了。通过ls -la 是可以看到.git目录的。 但是因为没有任何提交,所以git log看不到内容。 你可以增加一个空文件,git add 之后,git commit,就能看到了
$] mkdir repository
$] cd repository/
$] git init ^C
$] ls -la
总用量 0
drwxr-xr-x 2 lphu lphu  40 2013-08-30 18:30 .
drwxrwxrwt 4 root root 120 2013-08-30 18:30 ..
$] git init
Initialized empty Git repository in /dev/shm/repository/.git/
$] git log
fatal: bad default revision 'HEAD'
$] touch readme
$] git add readme
$] git st
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#       new file:   readme
#
$] git commit -m 'first commint'
[master (root-commit) 204d84e] first commint
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 readme
$] git log
commit 204d84e96c75de90d52b8a7c3b6cac9976169830
Author: --------------------------------------
Date:   Fri Aug 30 18:30:51 2013 +0800

    first commint
$]

1,265

社区成员

发帖
与我相关
我的任务
社区描述
软件工程/管理 管理版
社区管理员
  • 研发管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧