yyy
05/02/2025

Git

设置
git config --global --list
git config --global -e
 
g
git config --global pager.log false
命令
git init   #初始化 git 仓库
git status   #显示当前仓库状态
git clone https://xxx.yyy.a.git   #克隆远程仓库 a 到当前目录
git pull   #从远程仓库拉取更新,并合并当前分支
 
git push origin v1.0:v1.0   #推送 v1.0 标签到远程
 
git log -3   #查看最近3次提交历史
git log origin/master -2   #查看远程 master 分支最近2次提交历史
git remote -v   #查看远程仓库地址
git remote set-url origin http://github.com/wekeey/xxx.git   #修改本地仓库地址
git remote add gitee [email protected]:wekeey/xxx.git   #新增远程仓库地址
git push --all gitee   #推送修改到远程仓库
 
git reset HEAD   #撤销提交的修改
git checkout *   #恢复删除的文件,没有 commit 情况下