4 ms·
>> And the Git staging area should be an opt-in feature. Thousands of yes! `git commit -a` just doesn't add the untracked files it is the most annoying misfeat
by nurettin 9y ago
>> And the Git staging area should be an opt-in feature.
Thousands of yes! `git commit -a` just doesn't add the untracked files it is the most annoying misfeature of any version control system. Oh, I added unwanted project directories? I would then just remove them and put them to `.gitignore`, or create a `.gitignore` prior to `init`.
Of course I could just alias `add -A . && commit -m` on every machine I ever connect to for developing. There's a great, practical solution.
- jononor 9y agoAutomatically adding untracked files would make it extremely easy to commit (and without other safeguards, push) unwanted changes. Annoying things like node_modules or binary screenshots that now bloats the repo history forever (unless one rewrites the history), or potential security breaches like passwords/keys or logs/configs with confidential information.
- nurettin 9y agoThen there is .gitignore_global for your node_modules/
- GordonS 9y agoI seem to recall that Visual Studio Could has an option to immediately push all your commits to remote, bypassing staging. I kind of like staging tho; I find it helps keep me focused on small, self-contained pieces of work, instead of working on several pieces at once.
- forgottenpass 9y agoOf course I could just alias `add -A . && commit -m` on every machine I ever connect to for developing. There's a great, practical solution. Maximally practical or not, if you don't already have a repository for configuration files, shell scripts, aliases, and other little quality of life enhancements then create one today. Your git workflow isn't the only thing that will benefit. Next time you're hassled to do yet another "git config --global user.name" compare it to the hypothetical overhead of typing "git clone foo/homedir.git ~/homedir && ~/homedir/prep" to get both your name and aliases setup. I never thought I needed a dotfile repo, but once I made it I realized I waited way too long. It doesn't have to be anything fancy, just take 10 minutes and lay the groundwork to help yourself develop more quickly.
- nurettin 9y agoI did try this, but it comes with the extra work of managing yet another git repo, which you conveniently ignore. It requires workarounds such as making a bare repo, turning off showing untracked files, then you have branches for multiple computers and it's all a mess in no time. Perhaps there is a better alternative to saving and loading your dotfiles?