# git **Repository Path**: gricks/git ## Basic Information - **Project Name**: git - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-03-07 - **Last Updated**: 2021-05-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # create tag ``` git tag v1.0.0 git push origin v1.0.0 ``` # pull rebase ``` git rebase commit git pull --rebase ``` # rebase commit ``` git commit -a -m "first commit" git commit -a -m "second commit" git commit -a -m "thirds commit" git rebase -i 0e03828 (it's must before you push to remote) ``` # show all branch ``` git br -a -vv ``` # create remote branch ``` local to remote git co -b branch-name / git co [commit_hash] -b branch-name git push origin branch-name git br -u origin/branch-name branch-name local to remote git co -b branch-name / git co [commit_hash] -b branch-name git push -u origin branch-name remote to local git co -t origin/remote-branch-name remote to local git co -b local-branch-name origin/remote-branch-name ``` # delete remote branch ``` git br -r -d origin/remote-branch-name git push origin :remote-branch-name ``` # reset ``` git reset --hard 83b78c3 ``` # remove from history ``` git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch path-to-your-remove-file' --prune-empty --tag-name-filter cat -- --all git push origin master --force --all git push origin master --force --tags rm -rf .git/refs/original/ git reflog expire --expire=now --all git gc --prune=now git gc --aggressive --prune=now ``` # modify remote origin ``` git remote set-url origin [remote-url] ``` # ls ``` git ls-files '*.go' ``` # auto completion ``` source /etc/bash_completion.d/git ``` # parse ``` git describe --abbrev=0 --tags git rev-parse HEAD aldkfjasdfj ``` # multiple remote ``` git remote set-url --add origin git@gitee.com:gricks/sparrow.git ```