Git & GitHub

  1. Git教程
  2. Linux命令大全——GIT命令
  3. 如要进入F:/Git/learngit, 在git bash中用cd /f/git/learngit. 删除learngit目录,用rm -r learngit,参考linux rm命令。关于cd命令touch a.txt新建文件。
  4. linux命令大全
  5. Many Git online resources are accessible from https://git-scm.com/ including full documentation and Git related tools. See Documentation/gittutorial.txt to get started, then see Documentation/giteveryday.txt for a useful minimum set of commands, and Documentation/git-.txt for documentation of each command. If git has been correctly installed, then the tutorial can also be read with man gittutorial or git help tutorial, and the documentation of each command with man git-<commandname> or git help <commandname> or <commandname> --help. You can also download the git master .zip file
  6. git log, 按q退出。
  7. 删除本地git中的repository,直接在本地删除文件夹。在GitHub上删除repository,先打开该repository,如下图,点开settings,拉倒最下面,找到delete。这里写图片描述
  8. vi编辑文件内容,参考linux vi命令。eg: vi readme.txt. 按a进入insert状态,编辑完成后,按ESC键 跳到命令模式,然后:
    :w 保存文件但不退出vi
    :w file 将修改另外保存到file中,不退出vi
    :w! 强制保存,不推出vi
    :wq 保存文件并退出vi
    :wq! 强制保存文件,并退出vi
    q: 不保存文件,退出vi
    :q! 不保存文件,强制退出vi
    :e! 放弃所有修改,从上次保存文件开始再编辑。
  9. 创建仓库用init或clone。下面列举出了init的三种方式:
    这里写图片描述

    使用git clone http://myrepo.xxx.com/project/.git只能克隆master分支,要clone其他分支,使用git checkout -b dev origin/dev,得到并转到dev分支。如果只想clone dev分支,不需要master,可以使用git clone -b dev origin
  10. 10.