LiuL0703 / blog

https://liul0703.github.io
38 stars 11 forks source link

Git常用操作 #20

Open LiuL0703 opened 6 years ago

LiuL0703 commented 6 years ago

Git

git 删除远程分支:git push origin --delete{} git查看远程分支:git branch -r git 切换远程分支:git checkout [name] git stash 保存当前修改 但不提交commit git stash apply{stash@{n}} 回到某个stash状态

将某次提交应用到指定分支 git checkout {branch-name} git cherry-pick {hash}

重命名分支名

  1. Rename your local branch. git branch -m new-name
  2. Delete the old-name remote branch and push the new-name local branch.git push origin :old-name new-name
  3. Reset the upstream branch for the new-name local branch. git push origin -u new-name

Git commit重命名

How to change your commit messages in Git

更多Tips