banner
keney

keney

remain optimistic
twitter

git specify single file commit

Background#

When using IDEA to commit files, if you are trying to commit large files or too many files, you may find that the files cannot be submitted. This can also be resolved in the IDEA settings, but sometimes it is not convenient. Therefore, there is a method to use Git to specify file commits to solve the submission issue in IDEA.

Basic Command Operations#

Git specify file commit

Before committing code, first pull the code

git pull

Check file status

git status

Temporarily store the modified file in the staging area

git add project_path
# For example: git add D:\workspace\code\gitlab\company_project_learn\com\node-v18.17.1-x64.msi

Commit this file:

git commit -m "Add a certain feature"

Push to the repository

git push

Extension:

Indicates adding all files to the staging area, use with caution

git add .

Reason: Some configuration changes are not committed, but are only for local running and debugging. During development, only commit the files we need to submit.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.