git一文通关

1.git 常用命令

1.仓库

git init

**git init <name> **

git clone <url>

2.git 配置

git config --list

git config -e

git config user.name <name>

git config user.email <email>

3.文件增删

git add <file>

git add .

git rm <file>

git rm --cached <file>

4.提交

git commit -m <message>

git commit -a 工作区直接到仓库区

5.分支

git branch

git branch <name>

git checkout <name>

git checkout -b <name>

git merge [name] 合并指定分支到当前分支

git branch -d <name> 删除指定分支

git branch -dr [name] 删除远程分支

6.标签

git tag [tag] 新建一个tag在当前commit

git tag [tag] [commit]

git tag -d [tag]

git push origin :refs/tages/[tagName] 删除远程tag

git show [tag]

git push [remote] [tage] 提交指定的tage

7.查看

git status

git log

git diff 查看暂存区和工作区的差异

git show [commit] 查看提交

8.远程仓库

git fetch [remote] 下载远程仓库的所有变动

git remote -v 显示所有远程仓库

git remote add [shortname] [url] 添加远程仓库

git pull [remote] [branch] 下载远程仓库的变化

git push [remote] [barnch] 上传本地分支到远程仓库

git push [remote] --all

9.撤销

git checkout [file] 恢复暂存区的指定文件到工作区

git reset [file] 重置暂存区文件

git revert [commit] 回退到指定提交

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值