git命令记录

git 查看用户名和邮箱地址

$ git config user.name
$ git config user.email

  

修改全局用户名和邮箱地址

$ git config --global user.name  "username"     
$ git config --global user.email "email"        

 

修改局部用户名和邮箱地址:

$ cd ~/you project                       
$ git config user.name  "username"      
$ git config user.email "email"  

 git 提交代码的步骤

echo "# nothing" >> README.md

git init

git add README.md

git commit -m "first commit"

git remote add origin git@github.com:DoctorMan/study_scala.git

git push -u origin master

git remote remore origin
git remote show origin

git 创建新分支

git checkout -b branch_name

切换远程链接库

git remote set-url origin URL

【git remote rm origin】 删除现有远程仓库 
【git remote add origin url】添加新远程仓库

  

posted @ 2019-01-24 16:17  Commander·  阅读(155)  评论(0编辑  收藏  举报