-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Auto-set a generated app as a git repo #385
Comments
Please add a discussion label to this issue. |
What do other tools (ember cli, angular cli) do? |
@gaearon I'd say by default do the same as |
Let's do what Ember CLI does, sans the Tomster. Would you like to send a PR? |
@gaearon I can do it. Are there some extra requirements beyond initializing a repo and making the first commit?
|
A must.
I think initializing git is a sane default. @vjeux Any objections?
Yes. |
I actually think this is unneeded default. From my personal experience most of the time the React client code is part of a bigger project with server code that is already under version control. Also there are a lot of people using Mercurial. The most sane option is to output the necessary steps after a new project is created, just as when you create a build suggestion is shown to run a push-server. |
We could detect if the folder is part of a git repo and bail. |
I think that it's pretty common nowadays to create a git repo for every small project. I'm down to do it by default. |
I don’t feel strongly about this and I don’t think it’s important at this point so I’ll close. |
Nooooo... I've just started working on this 😢 Luckily I'm still in the planning stage. Was looking around the |
Haha, sorry 😄 |
This keeps coming up: #1244. |
How hard could it be to do |
It’s not really hard but I often find myself forgetting to do it, and by that point I have changed something and can’t roll back. This can be a real issue for beginners. I agree with your concerns in #385 (comment) but there is nothing preventing us from checking if we’re inside a Git/Hg project before attempting to create a repo. |
Maybe I could continue where I left off the last time but not today. |
Let’s coordinate work on this in #1244. |
A side discussion I started in #368 is how to manage a created app with GitHub(or another git server). In short, there are 2 ideas:
option 1: add a --git option to
create-react-app
create-react-app my-app --git https://github.com/username/my-app.git
locally and try to create an app in the cloned repo folder.Note: assume user doesn't add conflicted filed (listed in #368) between step 1 and 2.
option 2: add extra 2 steps to
create-react-app
git init
when initial an app,create-react-app set-github-remote
.rm -rf .gitignore .git
if user don't want to set gitOption 1 is closer to my workflow of using other code generators, but I prefer option 2 if it is available (save me a few minutes of wandering on GitHub).
I am happy to try adding both options to CRA if you like. I see most of the work has been done by @torifat in PR #368.
The text was updated successfully, but these errors were encountered: