git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Getting rid of "hint: Using 'master' as the name for the initial branch." when initializing a repository with pygit

From
Taylor Blau <me@ttaylorr.com>
Date
Feb 1, 2022, 20:15 UTC
Message-ID
<YfmU+D7wB2ePMGTZ@nand.local>
In-Reply-To
<20220201200246.GW3113@kunlun.suse.cz>
On Tue, Feb 01, 2022 at 09:02:46PM +0100, Michal Suchánek wrote:
Show 7 quoted lines
> On Tue, Feb 01, 2022 at 02:52:41PM -0500, Taylor Blau wrote:
>
> > If you have set the init.defaultBranch configuration, we will suppress
> > the hint you're talking about.
>
> That's the problem - there is no way to pass the configuration when
> using a library to create a repository.

Of course; but I was suggesting that you set it in $HOME/.gitconfig, or in your global /etc/gitconfig.

Show 5 quoted lines
> > Alternatively, you can make sure that `git init` is invoked with the
> > `-q` (quiet) flag, which suppresses that warning whether or not you have
> > set the init.defaultBranch config.
>
> Yes, that is exactly the option that would do it.

OK, I assume that this means that you can pass custom flags down to `git init` via the library you're using.

Thanks, Taylor

Previous: Michal SuchánekNext: Michal Suchánek
Message 4 of 5 in “Getting rid of "hint: Using 'master' as the name for the initial branch." when initializing a repository with pygit”
  1. Michal SuchánekFeb 1, 2022
  2. Taylor BlauFeb 1, 2022
  3. Michal SuchánekFeb 1, 2022
  4. Taylor BlauFeb 1, 2022
  5. Michal SuchánekFeb 1, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.