-2

Ok so i have been wondering is there any way to make a command according to my desires for example

This is for large scale projects "I want to commit/add all the files except this(files 1) this(file2) and this(file3)

I know that you can add/commit by

git add file1 file2 file3 

or

git commit file1 ...

but i want it another way around

Thanks.

2

1 Answer 1

0

I don't have much experience with working on large projects, but in small projects, mostly I remember the name of the files which are to be excluded from commit like as you mentioned file1 file2 or file3. So what I do is just staged all the files first and then unstaged the files which are to be excluded by running the following command

git restore --staged file1 file2 file3

Using this command you can remove the files from staging area to the unstaged area and hence prevent commit for those files for that time

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.