blog icon indicating copy to clipboard operation
blog copied to clipboard

Git常用操作

Open LiuL0703 opened this issue 6 years ago • 0 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

LiuL0703 avatar Sep 21 '18 03:09 LiuL0703