—— 阿尔伯特·爱因斯坦

程序员の奇妙冒险

GitGit
2025-04-03 15:23阅读:52评论:0

git 常用命令笔记

Git配置 SSH配置 查看提交版本 滚回指定版本 不解决冲突强制推送回退版本到远程 克隆项目 git查看远程仓库地址 修改远程仓库地址 查看所有分支 切换分支 查看当前使用分支(结果列表中前面标*号的表示当前使用分支) 修改当前仓库地址 一次性提交全部分支 一次性推送很多标签 拉去子模块 设置当前

_PROTECTED0__
1
2
3
4
5
6
7
Gitgit bash
git config --global user.name
git config --global user.email
 
cat /home/czw/.ssh/id_rsa.pub >> /home/czw/.ssh/authorized_keys
 
_PROTECTED0__
1
2
3
4
1git bash
2ssh-keygen -t rsa 3使Git id_rsaid_rsa.pubstart ~  .ssh
3cat ~/.ssh/id_rsa.pub  
 
_PROTECTED0__
1
2
git log -3
 
_PROTECTED0__
1
2
3
4
git reset --hard e21db9152473821164cd9b2436c9ecf07780cbfa
 
e21db9152473821164cd9b2436c9ecf07780cbfa
 
_PROTECTED0__
1
2
git push -f
 
_PROTECTED0__
1
2
git clone
 
_PROTECTED0__
1
2
git remote -v
 
_PROTECTED0__
1
2
git remote set-url origin url()
 
_PROTECTED0__
1
2
3
4
git branch -a
remotes/origin/my-dev
 
_PROTECTED0__
1
2
git checkout -b my-test origin/my-test
 
_PROTECTED0__
1
2
git branch
 
_PROTECTED0__
1
2
git remote set-url origin http://ip
 
_PROTECTED0__
1
2
git push --all origin -u
 
_PROTECTED0__
1
2
git push origin --tags
 
_PROTECTED0__
1
2
3
1git submodule init
2git submodule update
 
_PROTECTED0__
1
2
git config http.proxy http://127.0.0.1:2334
 
_PROTECTED0__
1
2
git config --unset http.proxy
 
_PROTECTED0__
1
2
git config --global --unset http.proxy
 
_PROTECTED0__
1
2
git config http.proxy socks5://127.0.0.1:10809
 
评论(0)
暂无评论来抢沙发吧~