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

新手用git

时间:2016-03-08 23:15:11      阅读:248      评论:0      收藏:0      [点我收藏+]

标签:

  最近几天用到了git,作为只看过教程,没有在实际项目中使用过的人来说,简直是 T_T ......

  在这里记录一下,以防以后忘记。

  1. clone :本地没有该库,从远程repository拷贝到本地
  2. pull : 本地有该库,将远程repository的新commit下载到本地,并与本地merge
  3. 提交新的变更,一般的步骤是:
    > git add .
    > git commit -m "new commit"
    > git push
  4. 遇到的几个问题:
    1. fatal: LF would be replaced by CRLF / fatal: LF would be replaced by CRLF http://blog.csdn.net/lysc_forever/article/details/42835203
    2. fatal: No remote repository specified. Please, specify either a URL or a remote name from which new revisions should be fetched. : 可能是由于 .git/config 中配置不当,搜到了这篇文章(http://www.myexception.cn/operating-system/1470149.html),笔者贴上了一个模板,如下:

      [core]
          repositoryformatversion = 0
          filemode = true
          bare = false
          logallrefupdates = true
          ignorecase = true
          precomposeunicode = false
      [remote "origin"]
          url = https://github.com/CrossLee/xxx.git
          fetch = +refs/heads/*:refs/remotes/origin/*
          pushurl = https://github.com/CrossLee/xxx.git
      [branch "master"]
          remote = origin
          merge = refs/heads/master

      其中 url pushurl 换成自己的项目地址。

新手用git

标签:

原文地址:http://www.cnblogs.com/noteit/p/5255769.html

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