git 常用命令

1、设置全局的git push username 和email
git config --global user.name "your name"
git config --global user.email "your email"
 
2、create new branch
C:\workspace\git\project>git checkout -b newBranchName //create new branch
Switched to a new branch 'newBranchName '
M package.json
C:\workspace\git\project>git branch //show all branches
master
* newBranchName
C:\workspace\git\project>git push origin newBranchName //push to github
Total 0 (delta 0), reused 0 (delta 0)
To github.test.com:Group/test.git
* [new branch] newBranchName -> newBranchName
C:\workspace\git\project>git push --set-upstream origin newBranchName //设置push repository
 
3、git merge:
git checkout master
git merge branchA
git branch -d branchA 删除branchA
posted @ 2018-06-27 22:31  卤蛋儿  阅读(151)  评论(0编辑  收藏  举报