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:
create-react-appcreate-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.
create-react-appgit 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.
Please add a discussion label to this issue.
What do other tools (ember cli, angular cli) do?
@gaearon ember-cli initializes a git repo for you by default and makes an initial commit. No remote is added, you have to do it yourself. No instructions are provided. Some ascii art included in the initial commit (GitHub for Mac screws up fonts tho). See attached pics.
I'd say by default do the same as ember-cli does and provide --git switch to automatically set up a remote.


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?
Cross platform compatibility?
A must.
I assume that we don't want any switches described above
I think initializing git is a sane default. @vjeux Any objections?
Do we want to let the user know we initialized a repo for them?
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鈥檛 feel strongly about this and I don鈥檛 think it鈥檚 important at this point so I鈥檒l close.
Nooooo... I've just started working on this 馃槩 Luckily I'm still in the planning stage. Was looking around the ember-cli codebase. If we've decided to do it later, here's how ember-cli does it.
Haha, sorry 馃槃
This keeps coming up: https://github.com/facebookincubator/create-react-app/issues/1244.
Maybe let鈥檚 do it?
How hard could it be to do git init that it needs to become a default for CRA? I would rather see this as a part of the User Guide with a sample .gitignore provided.
It鈥檚 not really hard but I often find myself forgetting to do it, and by that point I have changed something and can鈥檛 roll back. This can be a real issue for beginners.
I agree with your concerns in https://github.com/facebookincubator/create-react-app/issues/385#issuecomment-249408036 but there is nothing preventing us from checking if we鈥檙e 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鈥檚 coordinate work on this in https://github.com/facebookincubator/create-react-app/issues/1244.
Most helpful comment
I don鈥檛 feel strongly about this and I don鈥檛 think it鈥檚 important at this point so I鈥檒l close.