softnanolab / softnanotools

Tools for programming
GNU General Public License v3.0
4 stars 0 forks source link

Fix git init to main branch in generate/_project.py #22

Closed debeshmandal closed 1 year ago

shanilpanara commented 1 year ago

After running the commands

pip install softnanotools
cd /tmp
softnanotools.generate project example --pre-commit --pip-install

I get the following output

image

shanilpanara commented 1 year ago

I've found the issue: git init -b main only works in git versions 2.28 or later, I have 2.25.1

shanilpanara commented 1 year ago

Easy solution:

git init # default branch is named to master < 2.28 and main >= 2.28
git branch -M main # rename default brain to main regardless of the previous default branch name!