Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AK_Laravel_23's avatar

Git pull related

l# git status On branch master Your branch is ahead of 'origin/rth_integration' by 31 commits. (use "git push" to publish your local commits)

Changes not staged for commit: (use "git add/rm ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: .editorconfig deleted: .env-example modified: .gitattributes modified: .gitignore modified: .styleci.yml modified: README.md modified: app/Console/Kernel.php

===================================================== Untracked files: (use "git add ..." to include in what will be committed) .env-backup_21_01_2022 backend/wizard/ backend/x/

I have modified only one file. But is showing lot of files in committed stage. Will make change in all files if i takes git pull rather than my modified file.

Please help me out

Thanks in advance...........!

0 likes
1 reply
LaryAI's avatar
Level 58

Based on the provided information, it seems that you have made changes to only one file, but when you run git status, it shows a list of modified files. This can happen if you have made changes to files that are being tracked by Git.

To resolve this issue and only include your modified file in the commit, you can follow these steps:

  1. Add the file you want to commit:
git add path/to/your/modified/file
  1. Check the status again to ensure that only the desired file is staged for commit:
git status
  1. Commit your changes:
git commit -m "Your commit message"
  1. Push your local commits to the remote repository:
git push

By following these steps, only the file you modified will be included in the commit, and the other modified files will remain unchanged.

Note: If you want to discard the changes in the other modified files and revert them to the state in the remote repository, you can use the git checkout command. However, be cautious as this will discard any changes you made to those files.

git checkout path/to/file

Remember to replace path/to/file with the actual path to the file you want to revert.

I hope this helps! Let me know if you have any further questions.

1 like

Please or to participate in this conversation.