-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gatsby-cli): Initialize the newly cloned repository as git #10868
Conversation
Thank you so much for this @caulagi Have you considered creating the initial commit as well? |
@pieh also makes a great point about creating a Would you like to add these to pull request? |
Thanks. I added the functionality to create a minimal Creating an initial commit should have a switch perhaps, so we can disable it? In that case, it would be a separate PR. |
I think we should make an initial commit by default. The Angular CLI, One more thing (sorry I should've mentioned earlier!): we want to check if the folder is already a mercurial or git repo before calling Presence of .git and .hg should be enough, I think |
Just the way we scaffold starters is by cloning starter git repository and purging |
Oh yeah! I was thinking of sites created within a monorepo but that is trickier to test for |
I added an initial git commit. The last few lines now look like this - info Initialising git in g6
Initialized empty Git repository in /private/tmp/nn/g6/.git/
info Creating minimal .gitignore in g6
info Create initial git commit in g6 |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works 👌
Time to get this merged! Thank you @caulagi to getting this done!
Holy buckets, @caulagi — we just merged your PR to Gatsby! 💪💜 Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! |
…byjs#10868) * feat(cli): Initialize the newly cloned repository as git * Create a minimal gitignore if it is missing * Make an initial git commit in the new directory * use cwd instead of chdir
Description
Initialize the newly cloned repository as a git repo. This is useful because a lot of the tooling (shell prompts, grep (via ripgrep), etc) honor
.gitignore
rules, when the directory has.git
. I add the following two lines at the endgatsby new
output -