列出本地分支列表: git branch
列出远程的所有分支: git branch -a
删除本地分支: git branch -D branchName
删除远程分支: git push -delete origin branchName
添加所有改变到暂存区: git add .
提交暂存区的改变到本地仓库: git commit -m "描述修改的内容"
推送本地代码到远程: git push origin branchName
拉取远程并且自动合并代码:git pull origin branchName
拉取当前分支代码与其它分支信息:git pull
切换分支:git checkout branchName
创建分支:git checkout -B branchName
合并分支:git merge sourceBranchName
拉取分支代码但不自动合并:git fetch origin branchName
隐藏当前工作空间的改变包括暂存区的改变(只有受到版本控制管理的文件才能隐藏);此功能用于紧急bug,但又不方便提交代码的场景
隐藏:git stash
查看:git stash list
git stash 可以形成list 集合。通过git stash list 可以看到list下的history
使用git stash apply @{x} ,可以将编号x的缓存释放出来,但是该缓存还存在于list中
而 git stash apply,会将当前分支的最后一次缓存的内容释放出来,但是刚才的记录还存在list中
而 git stash pop,也会将当前分支的最后一次缓存的内容释放出来,但是刚才的记录不存在list中
列出远程的所有分支: git branch -a
删除本地分支: git branch -D branchName
删除远程分支: git push -delete origin branchName
添加所有改变到暂存区: git add .
提交暂存区的改变到本地仓库: git commit -m "描述修改的内容"
推送本地代码到远程: git push origin branchName
拉取远程并且自动合并代码:git pull origin branchName
拉取当前分支代码与其它分支信息:git pull
切换分支:git checkout branchName
创建分支:git checkout -B branchName
合并分支:git merge sourceBranchName
拉取分支代码但不自动合并:git fetch origin branchName
隐藏当前工作空间的改变包括暂存区的改变(只有受到版本控制管理的文件才能隐藏);此功能用于紧急bug,但又不方便提交代码的场景
隐藏:git stash
查看:git stash list
git stash 可以形成list 集合。通过git stash list 可以看到list下的history
使用git stash apply @{x} ,可以将编号x的缓存释放出来,但是该缓存还存在于list中
而 git stash apply,会将当前分支的最后一次缓存的内容释放出来,但是刚才的记录还存在list中
而 git stash pop,也会将当前分支的最后一次缓存的内容释放出来,但是刚才的记录不存在list中