Skip to content

Commit 76ec553

Browse files
authoredAug 8, 2022
Use git init --initial-branch. (#8)
1 parent 82890d3 commit 76ec553

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎hooks/post_gen_project.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def main():
5252
if "{{ cookiecutter.add_readthedocs }}" == "no":
5353
remove_file(project_path, ".readthedocs.yaml")
5454

55-
subprocess.run(("git", "init"), check=True, capture_output=True)
55+
subprocess.run(
56+
("git", "init", "--initial-branch", "main"), check=True, capture_output=True
57+
)
5658

5759
if "{{ cookiecutter.make_initial_commit }}" == "yes":
5860
# Create an initial commit on the main branch and restore global default name.
@@ -70,7 +72,6 @@ def main():
7072
check=True,
7173
capture_output=True,
7274
)
73-
subprocess.run(("git", "branch", "-m", "main"), check=True)
7475

7576
if "{{ cookiecutter.create_conda_environment_at_finish }}" == "yes":
7677
if shutil.which("mamba") is not None:

0 commit comments

Comments
 (0)