Git常用命令
Git-常用命令
git全局设置信息
设置用户信息
1
2
3
4git config --global user.name "xiazhimiao"
git config --global user.email "xiazhimiao@qq.com"
GIT查看配置信息
1
2
3git config --list
GIT创建仓库
创建本地仓库
1
2
3git init
GIT克隆远程仓库
1
2
3git clone [远程仓库地址.git]
CRMSHPS:仓库不能嵌套
本地仓库常用命令
1
2
3
4
5
6
7
8
9
10
11git status 查看文件状态
-------------- * 是通配符
git add 将文件的修改加入暂存区
git reset 将暂存区的文件取消暂存或者切换到指定版本
-------------- [文件名]
-------------- --hard [版本号]
git commit 将暂存区的文件修改提交到版本库
-------------- -m "记录" [文件名]
git log 查看日志
GIT远程仓库操作
1
2
3
4
5
6
7
8
9
10
11
12git remote 查看远程仓库
-------------- -v 查看远程仓库地址
git remote add 添加远程仓库
-------------- origin [远程仓库地址]
git clone 从远程仓库克隆
-------------- [url]
git pull 从远程仓库拉取
-------------- origin master
git push 推送到远程仓库
-------------- origin master
GIT
Git常用命令
http://example.com/2024/07/22/Git常用命令/