git本地仓库管理
1、登录用户名和邮箱
$ git config --global user.name 'userName'
$ git config --global user.email '1475076156@qq.com'
2、创建git仓库
$ mkdir test
$ cd test
$ git init
3、向仓库添加文件
$ touch a1.php
$ git add a1.php //添加到暂存区
$ git status
$ git commit -m 'add a1.php'//将文件从暂存区提交到仓库
$ git status
4、修改仓库文件
$ vim a1.php
$ git status
$ git add a1.php
$ git status
$ git commit -m '修改了第一次git文件提交到仓库'
$ git status
5、删除仓库文件
$ rm a1.php
$ git rm a1.php
$ git commit -m '第一次通过git删除文件'
$ git status
************************git管理远程仓库********************************8
1、将远程仓库(github对应的项目)复制到本地
$ git clone https://github.com/userName/linuxStudy.git
2、创建文件
$ cd study/
$ touch a1.php
3、添加到暂存区
$ git add a1.php
4、添加到本地仓库
$ git commit -m '第二次通过git提交到仓库'
5、添加到远程仓库
$ git push
*************************查看配置文件*****************************
$ git config --list
01_github的使用
最新推荐文章于 2024-08-21 02:10:52 发布