git 自己使用心得(1)主线程 mac

1.创建一个文件夹存储远程仓库的内容

2.存储远程仓库的内容 ( cd “手拖文件就是文件地址” )

3.下载远程仓库内容  $git clone “git地址”

4.把新内容添加到 文件跟踪  $git add “内容”    (git reset HEAD 上一次add里面取消)

5.验证状态 $git status(Changes to be committed:已经在 stage区可以commit)

6.本地文件提交 $git commit -m “修改的内容”

7.添加至远程仓库 $git push

如果出现 E325: ATTENTION

 Found a swap file by the name ".git/.COMMIT_EDITMSG.swp"

          owned by: X  dated: Wed Jan 23 16:01:06 2013

        file name: ~X/Sites/mysite/.git/COMMIT_EDITMSG

          modified: no

        user name: X  host name: X-2.local

        process ID: 77109

While opening file ".git/COMMIT_EDITMSG"

            dated: Thu Jan 24 16:22:48 2013

      NEWER than swap file!

(1) Another program may be editing the same file.

    If this is the case, be careful not to end up with two

    different instances of the same file when making changes.

    Quit, or continue with caution.

(2) An edit session for this file crashed.

    If this is the case, use ":recover" or "vim -r .git/COMMIT_EDITMSG"

    to recover the changes (see ":help recovery").

    If you did this already, delete the swap file ".git/.COMMIT_EDITMSG.swp"

    to avoid this message.

Swap file ".git/.COMMIT_EDITMSG.swp" already exists!

[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:

解决 :$rm .git/.COMMIT_EDITMSG.swp

出现 — insert— 按s进入可输入状态输入:wq!退出

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 输入 y ,创建 git_hug 目录No githug directory found, do you wish...
    风花花阅读 2,005评论 0 4
  • 1.git的安装 1.1 在Windows上安装Git msysgit是Windows版的Git,从https:/...
    落魂灬阅读 12,724评论 4 54
  • git作为时下最流行的代码管理工具,Git权威指南总结了十条喜欢Git的理由: 异地协同工作; 现场版本控制; 重...
    古斟布衣阅读 1,851评论 0 12
  • 现在公司仍然用的是SVN,究其原因可能是领导层认为SVN比较“安全”,因为,给你一个内网IP你在除了公司外的地方无...
    西门淋雨阅读 365评论 0 1
  • Git 基础 基本原理 客户端并不是只提取最新版本的文件快照,而是把代码仓库完整的镜像下来。这样一来,任何一处协同...
    __silhouette阅读 15,968评论 5 147