Skip to content
GitLab
    • Explore Projects Groups Snippets
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
  • Merge requests
  • !2700

Unstage yarn.lock pre-commit

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/jdcrensh/git-rm-yarn-lock into master 8 years ago
  • Overview 9
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: jdcrensh

Since yarn.lock shouldn't be added to the repo, nor excluded via .gitignore, lets take advantage of lint-staged to unstage any staged yarn.lock files before they can even be committed.

Approval is optional

Merged by (Jul 25, 2025 12:30pm UTC)

Merge details

  • Changes merged into master with 3654c10a.
  • Deleted the source branch.

Activity


  • Administrator added CLA Signed label 8 years ago

    added CLA Signed label

  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: ggascoigne

    Why shouldn't it be checked in?

    The docs suggest otherwise https://yarnpkg.com/lang/en/docs/yarn-lock/.

    I should add that we specifically check this file in to get reproducible builds and would find it very awkward to work around this change.

  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: jdcrensh

    To be clear, this PR is relevant only to the create-react-app repo, where yarn.lock is neither committed nor gitignored. Apps using react-scripts would not be affected in any way.

  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: ggascoigne

    Ah, sorry, that makes much more sense.

  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: Timer

    Seems very useful to me, thanks!

  • Administrator added tag: internal label 7 years ago

    added tag: internal label

  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Merged by: Timer at 2017-08-02 01:52:26 UTC

  • Administrator closed 7 years ago

    closed

  • Administrator changed milestone to %1.0.11 7 years ago

    changed milestone to %1.0.11

  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: just-boris

    What's going on there? Why not to just add the file into .gitignore instead of abusing pre-commit hook functionality?

  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: gaearon

    We don’t want repo developers each to get their own lockfile that would be respected by Yarn. Since then they wouldn’t get the freshest versions that match what users would get.

  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: luftywiranda13

    @just-boris I wrote some of the reasons in https://github.com/luftywiranda13/remove-lockfiles#why :blush:

  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: gaearon

    In any case unstaging should be unnecessary now that we:

    • only support Yarn for development
    • have .yarnrc disabling the lockfile
  • Administrator mentioned in merge request !33 (merged) 7 years ago

    mentioned in merge request !33 (merged)

Please register or sign in to reply
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
2
CLA Signed tag: internal
2
CLA Signed tag: internal
    Assign labels
  • Manage project labels

Milestone
1.0.11
1.0.11
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference: facebook/create-react-app!2700
Source branch: github/fork/jdcrensh/git-rm-yarn-lock

Menu

Explore Projects Groups Snippets