Git 常用配置

52 阅读1分钟

1.推送本地仓库至远程新的仓库

git remote add origin git@github.com:name/repo.git
git push -u origin master

2 查看工程远程仓库地址

git remote -v 

3.添加或删除账号全局命令

git config --global user.email xxx@xx.com
git config --global user.name xxxx

git config --global --unset user.email
git config --global --unset user.name

4.查看全局账号命令

git config --global -l

5.git命令缩写配置

vim ~/.gitconfig

添加如下内容

[alias] 
        st = status
        co = checkout
        br = branch
        ci = commit
        mg = merge