I am fairly good at using git, but I need some help setting up a pattern to make it easy to build a base project, that I can clone and then make in...
For further actions, you may consider blocking this person and/or reporting abuse
Why not just clone the repo and delete the origin remote and push to a new remote that will be the actual project repo. Assuming you have template.git with the template and project.git as a bare repo:
Depends on what do you mean by a "base project".
If you want to have a certain file structure covered, just
git init
then init an application template with whatever your stack is (something likenpm init
).Or have the folder/file tree ready somewhere else and wrap it into a shell alias
cp -r /home/templates/stuff/* .
(also a cool opportunity to extend it to the function that inits your base project depending on an argument).If you want to have a blank project with a remote ready to go, you can also either use hub or create a new, let's say, GitHub repo with
curl -u 'username' https://api.github.com/user/repos -d '{"name":"my repository name"}'
. Github API can be very handy. Can also be wrapped in a function.There is so much stuff!
I think github currently has a feature which enables a dev to use a repo as a template for his other repo/projects.
Yes. I was hoping there’s an API we can use for this one but as of the time of writing, I can’t find it.
Spoke too soon, here it is folks: developer.github.com/v4/mutation/c...
sweet! i'll have to take a look. Thank you
Why not write a custom bash command?
or
From my understanding git deletes 'headless' branches, so rather than deleting .git/, you can just delete the branches and start a new branch & head. The old ones should just wither away, along with the data. Git man page says after 30 days it deletes that stuff.
So I actually write quite a few bash scripts, enough where I keep a repo of them. I just was really hoping that git, has a native command.
Most frameworks create a CLI script that downloads the zip version of the repo, extract it in the specified directory and run needed commands ( git init, npm install, etc )
I wrote something to help me with this, it has some added sugar to make common tasks automated by default as well.
angreal.gitlab.io/