git stash drop ( gstd ):从储藏队列删除最近一次储藏( stash@{0} )(git stash drop stash@{num} 从储藏队列删除指定储藏)
Branch
git checkout -b dev ( gco ):创建 dev 分支并从当前分支切换到 dev 分支
git branch ( gb ):查看所有分支
git checkout master ( gcm ):切换到主分支
git merge <branch> ( gm ):合并分支
git rebase master :先将 master 上的更改合并到当前分支,再添加当前分支的更改。如果有冲突,解决冲突后加 --continue 参数继续合并
git branch -d <branch> : 删除分支, -D 则强制删除分支
git merge <branch> --squash :将多次提交合并成一个,其流程如下:
# Go to the `master` branchgit checkout master# Create a temp branchgit checkout -b temp# Merge the feature/x branch into the temp using --squashgit merge feature/x --squash# See the new modifications/files in the Staging Areagit status# Create the unified commitgit commit -m "Add feature/x"# Delete the feature/x branchgit branch -D feature/x