Git命令小记
Git命令小记
Git
配置
查看git配置
git config -l
1
设置全局参数
git config --global core.autocrlf input
git config --global core.diff auto
git config --global core.syslinks false
1
2
3
2
3
[git] warning: LF will be replaced by CRLF | fatal: CRLF would be replaced by LF
快速打开git config
git config [--global] --edit
1
Win10下修改git全部配置文件方法
git config命令使用
分支
查看分支
//查看本地和远程所有分支
git branch -a
//查看远程所有分支
git branch -r
//查看本地分支
git branch
1
2
3
4
5
6
2
3
4
5
6
重命名分支
重命名本地分支
git branch -m old_local_branch_name new_local_branch_name
1
重命名远程分支
Step1:重命名远程分支对应的本地分支
git branch -m old_local_branch_name new_local_branch_name
step2:删除远程分支
git push origin :old_local_branch_name
step3:重新推送新命名的本地分支
git push origin new_local_branch_name
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
git分支重命名 & 删除tag & 删除远程分支后本地依然存在的解决办法
克隆分支
git clone -b 分支名 仓库地址
1
git 切换远程分支
//检出并切换分支
git checkout -b feature/training origin/feature/training
1
2
2
删除远程分支
git branch -r -d origin/branch-name
git push origin :branch-name
1
2
2
预览
除特别注明外,本站所有文章均为 Windcoder网 原创,转载请注明出处来自: gitminglingxiaoji
Loading comments...

预览
暂无数据