Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #8280
Closed
Open
Issue created Jan 03, 2020 by Administrator@rootContributor

Initialize git repo before template dependecies are installed

Created by: lukaszfiszer

Is your proposal related to a problem?

When creating a react app with a template that include a dependency requiring a git repo to work, the installation can fail or be incorrect for the developer that executes create-react-app on their machine. This is because the git repo is initialized after template dependencies are installed.

An example is a very popular package husky which adds git hooks to .git directory as part of its postinstall scripts. Those hooks won't be added for the person setting up the app with npx create-react-app ...

Describe the solution you'd like

  • split tryGitInit() into 2 separate functions - one that initializes the repo, second that creates commit.
  • move execution of the first function up, possible at the beginning of main init.js function

If you are OK with the proposed solution I'll be happy to prepare PR with the implementation.

Assignee
Assign to
Time tracking