新手上手步骤

使用 init 命令可以初始化一个仓库(repository),同时在当前目录下会生成一个用来跟踪管理版本库的 .git 文件夹(应当尽量避免使用含有中文的路径)

$ git init

显示git配置信息
$ git config --list

输入如下命令可以设置 Git 的用户名和Email
$ git config --global user.name “Your Name”
$ git config --global user.email “[email protected]

使用 git add 命令将新文件添加到仓库
$ git add gittest.txt

使用 git commit 命令将新文件提交到仓库
$ git commit -m “这里添加一些有意义的注释”
Git小翼新手学习01---2019/11/1
使用 git status 命令查看当前仓库工作区的状态

Git小翼新手学习01---2019/11/1
红色那那串字是提示:要么是gittest这个文件还没提交到版本库,或者被修改要重新提交

使用 git log 命令可以查看 commit 的记录
Git小翼新手学习01---2019/11/1
使用 git reflog 命令可以查看 commit 的记录(这个更好)
Git小翼新手学习01---2019/11/1
· 退回到之前的版本 hard 后面是 版本ID

$ git reset --hard 4da437f

新手的小错误

Git出现Unable to create ‘E:/xxx/.git/index.lock’: File exists.的解决办法
直接到.git文件下 吧 index.lock给删除了

相关文章:

  • 2022-02-13
  • 2022-12-23
  • 2021-08-06
  • 2021-05-22
  • 2021-06-30
  • 2021-07-23
  • 2021-08-29
  • 2022-12-23
猜你喜欢
  • 2021-09-15
  • 2021-11-10
  • 2021-07-31
  • 2021-08-26
  • 2021-10-08
  • 2021-08-16
  • 2021-06-22
相关资源
相似解决方案