git小手冊

来源:互联网 发布:财务管家婆软件 编辑:程序博客网 时间:2024/06/09 23:46

git手冊

初學者使用git,四步曲:

  • config
  • add
  • commit
  • push
    鏈接:http://symfony.cn/articles/git-guide.html

git遠程操作鏈接:

http://www.ruanyifeng.com/blog/2014/06/git_remote.html
上面提到了fetch,merge,pull的用法是比較簡單明了的

https://git-scm.com/book/zh-tw/v1/Git-%E5%9F%BA%E7%A4%8E-%E8%88%87%E9%81%A0%E7%AB%AF%E5%8D%94%E5%90%8C%E5%B7%A5%E4%BD%9C

錯誤情況整理

-fatal: remote origin already exists.
- 解決辦法:
- http://stackoverflow.com/questions/1221840/remote-origin-already-exists-on-git-push-to-a-new-repository
- http://stackoverflow.com/questions/10904339/github-fatal-remote-origin-already-exists

  • 重設remote:
    $ git remote set-url origin git@github.com:username/project_name.git

  • 或者移除原來的remote:
    $git remote rm origin
    $git remote add origin git@github.com:username/project_name.git

其他命令

  • 查看git的配置(config)信息
    $git config –list
  • 查看有哪些remote
    $git remote (-v) //加-v可查看remote的地址
    本Markdown编辑器使用[StackEdit][6]修改而来,用它写博客,将会带来全新的体验哦:

git工作流程

網上找的git的工作流程
參考:http://blog.programster.org/git-cheatsheet/

git簡明手冊:http://rogerdudler.github.io/git-guide/index.zh.html
git常用命令分類解釋:http://www.runoob.com/manual/github-git-cheat-sheet.pdf

0 0