Git的简单使用

来源:互联网 发布:淘宝有哪些孕妇装店 编辑:程序博客网 时间:2024/06/08 03:29

Git使用

git用起来很方便,一直都是用svn,今天有空就试了一下git用起来很简单:


一些常用的git命令

  • 对用户名进行标识
    git config – global user.name “用户名”
    git config – global user.email “邮箱”
  • 指定仓库的位置 mkdir创建文件
    cd D:
    mkdir creategit
  • 初始化
    git init
  • 将index.html 放入 creategit文件夹下
    git add index.html
  • 添加以后要提交
    git commit -m ‘提交’
  • 查看提交文件的状态
    git status
  • 查看修改文件的内容
    git diff index.html
  • 查看修改的日志
    git log
  • 返回上一步
    git reset –hard HEAD^
  • 查看内容
    cat index.html

原创粉丝点击