我们想制作一些我们可以共享的基本钩子脚本 - 例如预格式化提交消息.Git有通常存储在其下的钩子脚本<project>/.git/hooks/.但是,当人们进行克隆并且它们不受版本控制时,这些脚本不会传播.
有没有一种好方法可以帮助每个人获得正确的钩子脚本?我可以让这些钩子脚本指向我的仓库中的版本控制脚本吗?
它被认为是一种不好的做法 - 将.git/hooks放入项目存储库(例如,使用符号链接).如果是的话,为不同的git用户提供相同的钩子的最佳方法是什么?
如何创建分支别名,使其可以被推拉而不被视为单独的分支。一些背景:
我们有一个名为Production. 由于各种原因,我不能只是重命名分支。
$ git branch --all
* master
remotes/origin/HEAD -> origin/master
remotes/origin/Production
remotes/origin/master
Run Code Online (Sandbox Code Playgroud)
有时我会git checkout production错误地没有注意到它是一个新分支。没有远程分支production。也没有 ref origin/production。
$ git checkout production
Branch production set up to track remote branch production from origin.
Switched to a new branch 'production'
$ git status
On branch production
Your branch is up-to-date with 'origin/production'.
nothing to commit, working directory clean
$ git branch --all
master
* production
remotes/origin/HEAD -> origin/master
remotes/origin/Production
remotes/origin/master
Run Code Online (Sandbox Code Playgroud)
Git 创建了一个本地分支 …