您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
Git基本工作流程
发布时间:2019-05-02 17:36:34编辑:雪饮阅读()
安装好git后找到进入一个文件夹,然后鼠标右键‘Git Bash Here’即可在该文件夹下进入git命令行模式,支持linux的一些命令。
(1)设置用户名及邮箱
git config --global user.name 'xueyin220807'
注意这里的用户名就是你在github中注册的用户名
git config --global user.email '1509272975@qq.com'
(2)git初始化
$ git init
Initialized empty Git repository in C:/Users/Administrator/Desktop/新建文件夹/.git/
(3)查看git状态
$ git status
On branch master
No commits yet
nothing to commit (create/copy files and use "git add" to track)
(4)创建文件
$ touch 1.php
Administrator@xy-PC MINGW64 ~/Desktop/新建文件夹 (master)
$ git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
1.php
nothing added to commit but untracked files present (use "git add" to track)
Administrator@xy-PC MINGW64 ~/Desktop/新建文件夹 (master)
(5)提交到暂存区
$ git add 1.php
Administrator@xy-PC MINGW64 ~/Desktop/新建文件夹 (master)
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: 1.php
Administrator@xy-PC MINGW64 ~/Desktop/新建文件夹 (master)
(6)提交
$ git commit -m 'kasumi add 1.php'
[master (root-commit) e52a67f] kasumi add 1.php
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 1.php
Administrator@xy-PC MINGW64 ~/Desktop/新建文件夹 (master)
$ git status
On branch master
nothing to commit, working tree clean
关键字词:git
上一篇:Git管理远程仓库
下一篇:redhat5配置本地yum源