git misc

git misc

git branch

git branch                                    #查看有哪些branch
git checkout $branch                    #切换本地branch
git branch -D $branch                   #删除本地branch $branch,-D是-d(delete)和--force的组合

 git reset

git reset --hard HEAD^           #将本地的最新的commit hard reset,reset后code中将不会再有这个commit
git reset --soft $commit_id      #$commit_id是git log结果里第二条commit的id,reset后,code中仍然包含这个commit

 git tag

cco.git -tag | grep "^t-$branch_name*"

 

posted @ 2022-11-05 12:09  aspirs  阅读(33)  评论(0编辑  收藏  举报