Skip to content
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

Closed
Jiansen opened this issue Aug 6, 2016 · 17 comments
Closed

Auto-set a generated app as a git repo #385

Jiansen opened this issue Aug 6, 2016 · 17 comments

Comments

@Jiansen
Copy link
Contributor

Jiansen commented Aug 6, 2016

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

  1. create a repo using GitHub web interface
  2. runcreate-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

  1. automatically run git init when initial an app,
  2. after an app is generated, print out

Option 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.

@Jiansen
Copy link
Contributor Author

Jiansen commented Aug 6, 2016

Please add a discussion label to this issue.

@gaearon
Copy link
Contributor

gaearon commented Sep 3, 2016

What do other tools (ember cli, angular cli) do?

@mareksuscak
Copy link
Contributor

@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.

screen shot 2016-09-11 at 15 21 56

screen shot 2016-09-11 at 15 24 51

@gaearon
Copy link
Contributor

gaearon commented Sep 24, 2016

Let's do what Ember CLI does, sans the Tomster. Would you like to send a PR?

@gaearon gaearon added this to the 1.0.0 milestone Sep 24, 2016
@mareksuscak
Copy link
Contributor

mareksuscak commented Sep 24, 2016

@gaearon I can do it. Are there some extra requirements beyond initializing a repo and making the first commit?

  • Cross platform compatibility?
  • I assume that we don't want any switches described above
  • Do we want to let the user know we initialized a repo for him?

@gaearon
Copy link
Contributor

gaearon commented Sep 24, 2016

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.

@ivosabev
Copy link

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.

@gaearon
Copy link
Contributor

gaearon commented Sep 25, 2016

We could detect if the folder is part of a git repo and bail.

@vjeux
Copy link
Contributor

vjeux commented Sep 26, 2016

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.

@gaearon gaearon removed this from the 1.0.0 milestone Sep 30, 2016
@gaearon
Copy link
Contributor

gaearon commented Sep 30, 2016

I don’t feel strongly about this and I don’t think it’s important at this point so I’ll close.

@gaearon gaearon closed this as completed Sep 30, 2016
@mareksuscak
Copy link
Contributor

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.

@gaearon
Copy link
Contributor

gaearon commented Sep 30, 2016

Haha, sorry 😄

@gaearon
Copy link
Contributor

gaearon commented Dec 12, 2016

This keeps coming up: #1244.
Maybe let’s do it?

@ivosabev
Copy link

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.

@gaearon
Copy link
Contributor

gaearon commented Dec 12, 2016

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.

@mareksuscak
Copy link
Contributor

Maybe I could continue where I left off the last time but not today.

@gaearon
Copy link
Contributor

gaearon commented Dec 12, 2016

Let’s coordinate work on this in #1244.

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants