Melkeydev / go-blueprint

Go-blueprint allows users to spin up a quick Go project using a popular framework
https://docs.go-blueprint.dev/
MIT License
5.98k stars 337 forks source link

Feature: Initialize Git repository #21

Closed SudoSurya closed 1 year ago

SudoSurya commented 1 year ago

Added a command to execute npx gitignore go. The command generates a .gitignore file configured for Go projects.

SudoSurya commented 1 year ago

I made changes by injecting a .gitignore file instead of using NPX

SudoSurya commented 1 year ago

i made changes that now git branch defaults to main not master

Melkeydev commented 1 year ago

Unfortunately:

Error: exit status 128

This is what happens when I spin up a new project

SudoSurya commented 1 year ago

image

this error happens because when user has default settings to initialize a repo as main

image

so we force the branch to rename as main then it will not error out

SudoSurya commented 1 year ago

image

if we add -f flag its force rename it and even if it is main by default

SudoSurya commented 1 year ago

DEMO

test at your end also once

goprinttest.webm

SudoSurya commented 1 year ago

so i cant figure out the issue with switching to main branch. it working on my side (i tested on my friends machine it worked fine) anyway it not working on your side (i assume it has to do with some git issue or setting). so for now its good to stick with master branch .so i removed git branch -m main cmd.

SudoSurya commented 1 year ago

i removed switching to main branch cmd. you can review changes and merge if you think sticking with master branch is ok

basokant commented 1 year ago

i removed switching to main branch cmd. you can review changes and merge if you think sticking with master branch is ok

👍 I think this is fine too, especially considering that running git init will use the default branch setting on the user's machine, which most people have set to main anyway. And it's easy enough for the user to rename the branch anyway. Good work on the PR!