码迷,mamicode.com
首页 > 其他好文 > 详细

git使用说明

时间:2015-04-30 12:29:03      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:

初次使用请参考百度,google,博客园。这里也有一篇入门指南,简练精彩:http://www.kechuandai.net/git%E4%BD%BF%E7%94%A8%E5%B0%8F%E8%AE%B0/

我把自己碰到的问题记录下,备忘。

修改文件并提交到github。

[luwenwei@dev01v ~/git/helww/labs]$ vim README

[luwenwei@dev01v ~/git/helww/labs]$ git diff 
diff --git a/README b/README
index 39d8172..464c83f 100644
--- a/README
+++ b/README
@@ -3,3 +3,4 @@ This is my github website. Welcome!
 Here is introduction:
 1, labs is my lab, where some joy code is put
 2, this maybe isnot project, but who knows
+3, and some useful testcase

[luwenwei@dev01v ~/git/helww/labs]$ git commit README  -m "small change"
[master b8bc06a] small change
 1 file changed, 1 insertion(+)
[luwenwei@dev01v ~/git/helww/labs]$ git push origin master README
Enter passphrase for key /home/luwenwei/.ssh/id_rsa: 
error: src refspec README does not match any.
error: 无法推送一些引用到 git@github.com:helww/labs

[luwenwei@dev01v ~/git/helww/labs]$ git push origin master 
Enter passphrase for key /home/luwenwei/.ssh/id_rsa: 
Counting objects: 8, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 695 bytes, done.
Total 6 (delta 1), reused 0 (delta 0)
To git@github.com:helww/labs
   f005d79..b8bc06a  master -> master

解释:

git push origin master README

这句的意思是提交本地的commit到远程仓库,README是要提交的文件,但是此命令执行失败。

正确的命令是:git push origin master(把一次本地commit提交到远程仓库)

git使用说明

标签:

原文地址:http://www.cnblogs.com/helww/p/4468495.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!