01_github的使用

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值