-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress Git defaultBranch warnings #165
Comments
edmorley
added a commit
that referenced
this issue
Jan 25, 2021
In Git 2.30+, the `git init` command outputs a warning if `init.defaultBranch` is not set in the Git configuration: git/git@675704c Setting this default in `ci:setup` ensures that the warning does not spam CI logs every time `git init` is run. This config change only affects new repos created by `git init`, not repositories cloned using `git clone`. Hatchet uses `git init` when the path passed to `App.new` is a local directory, and not a repository cloned via `hatchet.lock`. This changes the default branch for new repos from `master` to `main`, however this works without further changes, since Hatchet already uses `git push HEAD:main`, where `HEAD` will reference the current branch regardless of its choice of name. This change is also compatible with older versions of Git, since they ignore unknown config file entries. Fixes #165.
schneems
added a commit
that referenced
this issue
Jan 25, 2021
…172) In Git 2.30+, the `git init` command outputs a warning if `init.defaultBranch` is not set in the Git configuration: git/git@675704c Setting this default in `ci:setup` ensures that the warning does not spam CI logs every time `git init` is run. This config change only affects new repos created by `git init`, not repositories cloned using `git clone`. Hatchet uses `git init` when the path passed to `App.new` is a local directory, and not a repository cloned via `hatchet.lock`. This changes the default branch for new repos from `master` to `main`, however this works without further changes, since Hatchet already uses `git push HEAD:main`, where `HEAD` will reference the current branch regardless of its choice of name. This change is also compatible with older versions of Git, since they ignore unknown config file entries. Fixes #165. Co-authored-by: Richard Schneeman <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running Hatchet on Travis I see lots of warnings from Git about the upcoming
defaultBranch
change. eg:To resolve these we could add
git config --global init.defaultBranch main
here:hatchet/etc/ci_setup.rb
Lines 31 to 33 in 97a18b8
The text was updated successfully, but these errors were encountered: