git的使用

​ 这是Git的基本使用方法

1.基本信息设置

1
2
3
4
git config --global user.name 'XXXXX'
用户名字设置
git config --global user.email 'XXXXX@qq.com'
用户邮箱设置

2.创建文件夹

1
mkdir XXXX

3.文件内初始化git

1
2
3
4
cd XXX
进入文件夹路径
git init
初始化git

4.增加文件

1
2
3
4
5
6
7
8
git status
查看状态
git add XXX
git status
增加,查看状态
git commit -m 'XXXXXXXXX'
git status
提交,查看状态

5.修改文件

1
2
3
4
5
6
7
8
git status
查看状态
git add XXX
git status
增加,查看状态
git commit -m 'XXXXXXXXX'
git status
提交,查看状态

6.删除文件

1
2
3
4
5
6
rm -f XXX(删除文件)
删除文件
git rm XXX
git删除文件
git commit -m 'XXXXX'
提交删除文件描述

7.远程访问仓库

1
2
3
4
5
6
7
8
9
先克隆github上面的仓库
git clone XXXX
克隆
git add XXX
增加
git commit -m 'XXXXXXXXX'
提交描述
git push
提交到github上面
-------------本文结束感谢您的阅读-------------

本文标题:git的使用

文章作者:Linhuide

发布时间:2020年03月20日 - 12:03

最后更新:2020年03月21日 - 01:03

原始链接:https://linhuide.github.io/post/2e742d51.html

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

坚持原创技术分享,您的支持将鼓励我继续创作!