1 |
On Fri, 06 Dec 2019 10:03:23 +0100 |
2 |
Alexis Ballier <aballier@g.o> wrote: |
3 |
|
4 |
> (*) and force the use of some handy git options like only commit paths |
5 |
> starting from cwd even if other files had been git added, which i never |
6 |
> remember what is the git cli option for this |
7 |
|
8 |
There isn't so much a CLI option, more, there's a parameter that "git |
9 |
commit" takes which allows you to enumerate which paths to commit. |
10 |
|
11 |
So: |
12 |
|
13 |
git commit |
14 |
|
15 |
Commits everything staged. |
16 |
|
17 |
git commit . |
18 |
|
19 |
Commits only CWD |
20 |
|
21 |
But, with one important caveat: |
22 |
|
23 |
git commit |
24 |
|
25 |
Will only commit changes previously added with "git add" or whatever to |
26 |
the index. |
27 |
|
28 |
git commit . |
29 |
|
30 |
Will commit *any* changes to anything in "." as long as they're |
31 |
"tracked" by git. |
32 |
|
33 |
But this is what repoman does anyway ;) |
34 |
|
35 |
The doc line for this in "git help commit" is: |
36 |
|
37 |
3. by listing files as arguments to the commit command (without |
38 |
--interactive or --patch switch), in which case the commit will |
39 |
ignore changes staged in the index, and instead record the current |
40 |
content of the listed files (which must already be known to Git); |