使用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