{"thread":{"id":"64018","subject":"[feature request] allow directly committing untracked files","startedAt":"2025-08-23T06:45:33Z","lastAt":"2025-08-25T07:45:08Z","messageCount":3,"participants":["Isaac Oscar Gariano","brian m. carlson","Michal Suchánek"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"524770","messageId":"SYBP282MB2963ABA12BD14594F62E47B08C3CA@SYBP282MB2963.AUSP282.PROD.OUTLOOK.COM","threadId":"64018","inReplyTo":null,"subject":"[feature request] allow directly committing untracked files","fromName":"Isaac Oscar Gariano","fromEmail":"isaacoscar@live.com.au","sentAt":"2025-08-23T06:45:30Z","receivedAt":"2025-08-23T06:45:33Z","isPatch":false,"sender":{"key":"isaacoscar@live.com.au","avatar":null},"body":"I often use 'git commit some-file -m 'some message'\" to quickly make a commit, but this is annoying as it doesn't work if some-file is untracked, you first have to do 'git add some-file'.\nIt would also be nice to do this with the `-a` option as well.\nIs there any reason why git does not let you do this?\nWould people be open to me making a patch that ads this? Would it need to be behind an option for backwards-compatibility?\n\n— Isaac Oscar Gariano​\n\n\n"},{"id":"524782","messageId":"aKnhvH1KHrAkfYwH@fruit.crustytoothpaste.net","threadId":"64018","inReplyTo":"SYBP282MB2963ABA12BD14594F62E47B08C3CA@SYBP282MB2963.AUSP282.PROD.OUTLOOK.COM","subject":"Re: [feature request] allow directly committing untracked files","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2025-08-23T15:43:56Z","receivedAt":"2025-08-23T15:44:04Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2025-08-23 at 06:45:30, Isaac Oscar Gariano wrote:\n> I often use 'git commit some-file -m 'some message'\" to quickly make a commit, but this is annoying as it doesn't work if some-file is untracked, you first have to do 'git add some-file'.\n> It would also be nice to do this with the `-a` option as well.\n> Is there any reason why git does not let you do this?\n\nI think we've seen a request for this before.\n\nI will say that I always stage changes ahead of time because I'll often\nwork on a few different things before committing[0] and I always want to\nbe very sure what I'm including, but I know not everyone does that.\nIt's also the case that sometimes files end up not being properly\nignored[1], so it's very easy to accidentally include files that you\nwouldn't ever want to commit.\n\n> Would people be open to me making a patch that ads this? Would it need to be behind an option for backwards-compatibility?\n\nI can see that it would be useful.  For instance, it could be convenient\nwhen writing tests of Git's behaviour where you really want to just\ninclude everything in the directory.\n\nIt would definitely need to be behind an option.  I might suggest\nsomething like this:\n\n    git commit --include-untracked -m \"message\" some-file\n\nOf course, we typically reserve a final opinion on a change until we see\na patch, since we're interested in both the idea behind the feature and\nthe implementation.\n\n[0] For instance, at work, I was fixing some software tests to run\nproperly with reftable and I fixed several different files before\ncommitting, each of which would have needed to be its own commit.\n[1] I've seen this in codebases in which tests are only infrequently run\nby hand and where the CI doesn't care about untracked files.\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"},{"id":"524856","messageId":"aKwUgSt2MnfRX4K7@kitsune.suse.cz","threadId":"64018","inReplyTo":"SYBP282MB2963ABA12BD14594F62E47B08C3CA@SYBP282MB2963.AUSP282.PROD.OUTLOOK.COM","subject":"Re: [feature request] allow directly committing untracked files","fromName":"Michal Suchánek","fromEmail":"msuchanek@suse.de","sentAt":"2025-08-25T07:45:05Z","receivedAt":"2025-08-25T07:45:08Z","isPatch":false,"sender":{"key":"msuchanek@suse.de","avatar":"https://avatars.githubusercontent.com/u/787652?v=4"},"body":"On Sat, Aug 23, 2025 at 06:45:30AM +0000, Isaac Oscar Gariano wrote:\n> I often use 'git commit some-file -m 'some message'\" to quickly make a commit, but this is annoying as it doesn't work if some-file is untracked, you first have to do 'git add some-file'.\n> It would also be nice to do this with the `-a` option as well.\n> Is there any reason why git does not let you do this?\n> Would people be open to me making a patch that ads this? Would it need to be behind an option for backwards-compatibility?\n\nHello,\n\nif the exposed index gets in your way you can consider some porcelain\nthat hides the index, such as jujutsu.\n\nThanks\n\nMichal\n"}]}