Skip to content

duanjj0929/git-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

git工具

写在前面

$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt

目录

配置

$ ./script/git_config.py

等价于下面的配置:

$ git config --global color.ui auto
$ git config --global core.autocrlf false/true
$ git config --global core.editor vim
$ git config --global log.date iso
$ git config --global push.default simple
$ git config --global credential.helper store

别名

$ ./script/git_alias.py

等价于下面的配置:

$ git config --global alias.br branch
$ git config --global alias.ci commit
$ git config --global alias.co checkout
$ git config --global alias.df diff
$ git config --global alias.last 'log -1 HEAD'
$ git config --global alias.st status
$ git config --global alias.unstage 'reset HEAD --'

仓库迁移

$ ./script/git_transfer.py --from=<from_git_url> --to=<to_git_url>
Preparing
Clone from <from_git_url>
Push to <to_git_url>
Finishing
Done

跟踪空目录

$ ./script/git_keep.py -d <starting-point> [-f <keep-file>]

规范化 commit-message

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
$ sudo npm install -g commitizen
$ sudo npm install -g cz-conventional-changelog
$ echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc

使用 git cz 代替 git commit

git-open

Type git open to open the repo website (GitHub, GitLab, Bitbucket) in your browser.

$ sudo npm install --global git-open

To configure GitLab support (or other unique hosting situations) you may need to set some options.

Releases

No releases published

Packages

No packages published

Languages