Blogger Information
Blog 15
fans 0
comment 0
visits 20694
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
git常用命令
李子的博客
Original
586 people have browsed it

GIT

1.初始化用户名

git config --global user.name "lizili"

2.初始化邮箱 

git config --global user.email "1394547708@qq.com"

3.初始化仓库(生成.git文件,仓库的配置信息)

git init

4.添加文件到本地Git仓库

git add <filename>

git commit -m "改动信息" 完成

5.查看仓库状态

git status #查看是否有文件被修改

git diff #查看修改内容

6.查看提交历史

git log

7.查看命令历史

git reflog

8.回到以前版本

git reset --hard 时间戳

9.撤销修改--工作区

git checkout <filename>

10.撤销修改--缓存区

git reset HEAD <file>

11.删除文件

git rm <file>

git commit -m "介绍"

12.添加远程仓库  (别名)

git remote add origin git@github.com:michaelliao/learngit.git

13.提交修改到远程仓库

git push -u origin master  #第一次

git push origin master     #以后

(别名) (本地仓库名)

14.克隆仓库

git clone https://github.com/UPBOTTOM/test.git

15.从远程仓库获得最新版本

git pull

16.创建分支

git branch

17.切换分支

git checkout 

18.切换并创建

git checkout -b

19.删除分支

git branch -d

20.合并分支

git merge name

21.生成秘钥

ssh-keygen -t rsa -C "user.email"


22.初始化Git仓库

git init --bare sample.git

教程

https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!