4
For example, I’m working on an x branch.
I changed the following files 1,2,3,4. I checked the git status all right. So far so good!
If I rotate the git add .
will add the 04 files.
How would you add only files 1, 2 and 3 leaving the 4 out?
4
For example, I’m working on an x branch.
I changed the following files 1,2,3,4. I checked the git status all right. So far so good!
If I rotate the git add .
will add the 04 files.
How would you add only files 1, 2 and 3 leaving the 4 out?
3
The .
(point) in git add
(in GIT versions 2.x) says you want to add in Stage all modifications that were made (all new files, all modified files and everything that was deleted).
Specify the files on git add
git add 1 2 3
0
You can also use some development ide to facilitate these processes.
For example in visual studio code,below Voce selects the file you want to add in Stage by clicking on + :
And below Voce puts your commit message:
By clicking the correct arrow, you commit. and clicking - you remove the file you added in Stage.
If you click on the synchronism symbol, it is possible to pull and push, the commands are used in that order, so do not overlap changes made in the branch
0
One possible solution is to use as parameter git add
the result of a subshell that when listing the directory ignore certain files. Example git add $(ls -I 4)
. It is possible to ignore file lists by extension, git add $( ls -I "*.h" "*.c")
.
Browser other questions tagged git
You are not signed in. Login or sign up in order to post.
Okay, I’ll take the test here. Thank you!
– Sena Oliveira