Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git常用操作 #20

Open
LiuL0703 opened this issue Sep 21, 2018 · 0 comments
Open

Git常用操作 #20

LiuL0703 opened this issue Sep 21, 2018 · 0 comments
Labels

Comments

@LiuL0703
Copy link
Owner

LiuL0703 commented Sep 21, 2018

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 LiuL0703 added the Git label Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant