Skip to content

Git

官网

用户配置

用户名

git config --global user.name zichou

用户邮箱

git config --global user.email 1303037989@qq.com

分支默认名

git config --global init.defaultBranch main

URL 替换

git config --global url.git@github.com:.insteadOf https://github.com/

分支 branch

查看

git branch

新建

git branch {branch_name}

删除 -d

git branch -d {branch_name}

切换 switch

git switch {branch_name}

重命名 -m

git branch -m {branch_rename}

reset

重置到指定版本

git reset {version}