sh Git Tags和Brancheshttp://makandracards.com/makandra/621-git-delete-a-branch-local-or-remotehttp://

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh Git Tags和Brancheshttp://makandracards.com/makandra/621-git-delete-a-branch-local-or-remotehttp://相关的知识,希望对你有一定的参考价值。

//locally tracked branches
git branch -vv
git branch -l

//list all branches
git branch -a

//list remote branches
git branch -r

//to list remote branches with locally tracked ones
git remote show origin

//fetch remote branches to local
git remote update
git fetch

//to rebase while git pull
git pull --rebase 
//to rebase before git push
git rebase -i @{u} 
(on “feature”) git merge master to make feature compatible with latest master
(on “master”) git merge --no-ff feature to ship a feature
However if “feature” contains only 1 commit, avoid the merge commit: (on “master”) git cherry-pick feature

//to stash local changes
git stash 
//to replay changes on a branch
git pop 

//branches, tags in git log
git log --oneline --decorate
//word diff
git diff --word-diff
//short status
git status -sb

//for setting tracking
git push -u origin master 
git checkout -t origin/feature

//rebases "feature" to "master" and merges it in to master
git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}

//to see whats cherry picked
git cherry -v master


git config --global branch.autosetuprebase always
git config --global push.default tracking
#delete tag on origin

$ git push --delete origin v1.2.1
#create branch
git checkout -b iss53


#to delete a local branch

git branch -d the_local_branch

#To remove a remote branch (if you know what you are doing!)

git push origin :the_remote_branch


# After the clone, you can list the tags with 

$ git tag -l

# and then checkout a specific tag:

$ git checkout tags/<tag_name>

# Even better, checkout and create a branch (other you will be on a branch named after the revision number of tag):

$ git checkout tags/<tag_name> -b <tag_name>

以上是关于sh Git Tags和Brancheshttp://makandracards.com/makandra/621-git-delete-a-branch-local-or-remotehttp://的主要内容,如果未能解决你的问题,请参考以下文章

sh [Git标签命令] #git #tags

sh Git片段#tags:bash

git diff 配置 meld diff

sh 重写本地git提交日期和时间

sh 从git安装和构建gstreamer

sh Git快进合并和拉动