git 常用命令
此内容尚不支持你的语言。
Git
Branch Naming
feat: add hat wobble^--^ ^------------^| || +-> Summary in present tense.|+-------> Type: chore, docs, feat, fix, refactor, style, or test.
More Examples:
feat
: (new feature for the user, not a new feature for build script)fix
: (bug fix for the user, not a fix to a build script)docs
: (changes to the documentation)style
: (formatting, missing semi colons, etc; no production code change)refactor
: (refactoring production code, eg. renaming a variable)test
: (adding missing tests, refactoring tests; no production code change)chore
: (updating grunt tasks etc; no production code change)
Git Command
- Maintain a repo without permission
git remote add upstream https://github.com/bfenetworks/bfe.git## agit fetch upstreamgit checkout develop
git merge upstream/develop## orgit rebase upstream/develop## Refer: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork
## bgit pull ups mastergit rebase ups/masterhttps://levelup.gitconnected.com/how-to-update-fork-repo-from-original-repo-b853387dd471
- git config setting
git config --global core.hooksPath .github/hooksgit config --global core.excludefile .gitignore_globalgit config --global url.'ssh://git@github.com'.insteadOf https://github.com
- Github Commit. For Close Github Issue, commit message should as follow:
close #xcloses #xclosed #xfix #xfixes #xfixed #xresolve #xresolves #xresolved #xadd new quick sort algorithm, fixes #4, resolve #6, closed #12
git submodule update --init -f vendor/github.com/mholt/caddygit remote add ups https://github.com/airdb/bgit push -u ups local_branch:master -f
- Github Command Line
brew install github/gh/ghgh --repo bbhj/lbs issue statusgh --repo bbhj/lbs issue view 1
- Delete branch or tag
git branch -D devgit push origin --delete dev
git tag -d v1.0git push --delete origin v1.0
- submodule
git submodule update --init --recursive --remote
Push Branch to Another Branch
git push <remote> <local_branch>:<remote_name>
Push Branch to Another Repository
git push <remote> <branch>
Github
For now, we can use gh
command for few git operation.
Rerfer here
Semantic Commit Messages
See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
github下fork后如何同步源的新更新内容
git remote -v
git remote add upstream https://github.com/bfenetworks/bfe
## 同步 forkgit fetch upstream
## 切换到 upstream 分支git checkout upstream/develop
## 将 upstream 分支 push 到 fork 项目对应分支git push origin upstream/develop:develop -f
References: