LiuL0703 / blog

Home Page:https://liul0703.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Git常用操作

LiuL0703 opened this issue · comments

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