Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

shoaibarham/nextjs

Repository files navigation

FG Admin Panel

An admin panel backend project in nest.js!

Requirements

npm version nest version

Installation

First, install TypeScript in your local project folder:

$ npm install typescript@5.4.5

Next, install all project dependencies:

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

Test

# unit tests
$ npm run test

Resolving Line Ending Issues in Git (Occur when you run 'npm run check')

When working across different operating systems (e.g., Windows and Linux), line-ending differences can cause unintended changes in your Git repository. This guide explains how to resolve these issues and prevent them in the future.

Steps to Fix Current Issues

1. Check What Has Changed

First, identify which files Git detects as modified:

git status

If files you didn’t intentionally modify are listed (typically due to line-ending changes), proceed to the next steps.


2. Stage the Files

Add all modified files to the staging area:

git add .

This prepares the files for the next step.


3. Reset the Files

Discard any unintended changes, including line-ending differences, by resetting the staged files:

git reset --hard

What Happens Here?

  • All uncommitted changes (including line-ending changes) are removed.
  • Files are reverted to their exact state from the latest commit.

⚠️ Warning: This will discard all uncommitted changes. Ensure you’ve saved any work in progress before running this command.


4. Normalize Line Endings

To prevent line-ending issues in the future, normalize the line endings in your repository:

  1. Add a .gitattributes File Create or update a .gitattributes file in the root of your repository with the following content:

    * text=auto
    

    This configuration ensures:

    • Git converts all line endings to LF when committing.
    • During checkout, line endings are converted to the appropriate format (CRLF or LF) based on the OS.
  2. Renormalize the Repository After adding the .gitattributes file, normalize the line endings across all files:

    git add --renormalize .
    git commit -m "Normalize line endings"

    This updates the repository to ensure all files comply with the specified line-ending format.


5. Verify Changes

After completing the above steps, check that no unintended changes remain:

git status

If the working directory is clean, the issue is resolved.


Summary of Commands

Here’s a consolidated list of commands to resolve line-ending issues:

git add .
git reset --hard
git add --renormalize .
git commit -m "Normalize line endings"

Prevent Future Issues

To avoid recurring line-ending problems, ensure consistent Git configurations across all environments:

For Linux/MacOS:

git config --global core.autocrlf input

This converts CRLF to LF on commit but does not modify LF on checkout.

For Windows:

git config --global core.autocrlf true

This converts LF to CRLF on checkout and back to LF on commit.


By following these steps, you can resolve existing line-ending issues and maintain consistent behavior across different operating systems.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.