Mac下git用户名密码问题

使用git时,不提示输入用户名和邮箱是因为在系统里已经保存了信息

应用>>钥匙串访问 对其操作即可

常用命令:

查看用户名

git config user.name

查看邮箱

git config user.email

设置用户名

git config --global user.name "julian" 

设置邮箱

git config --global user.email "xxxxx@qq.com"

初始化仓库

git init

提交到git

git add .         //添加到暂存区
git commit -m '本次提交的备注' 

仓库状态

git status    //查看版本库状态,什么被修改过但还没提交的
git diff      //查看当前相对上一次提交修改的内容

 远程仓库信息

git remote -v

拉取&推送

git pull
git push origin <tagname>

当前git配置

cat .git/config

查看所有分支

git branch -r 

创建并切换到分支

git checkout -b  xxx

删除分支

git push origin --delete xxx

修改分支名称(本地)

git branch -m old_name new_name

更详细的 via https://www.cnblogs.com/Angxf/p/10956416.html

原文地址:https://www.cnblogs.com/julian-chang/p/11818269.html