This should be a breeze for some experienced git users, I hope.
I’d like to use a single command, that when issued, would make git synchronize with the current state of my project directory. In contrast to having to issue separate commands for adding files added to my project, deleting files removed from it, etc. Rationale being that I do not need that additional layer of acknowledging each change to my project just for the sake of git, I’d rather have git just reflect the directory (when I find that it is a good sync point worth syncing into git).
That is also the approach taken in Github for Windows. It just syncs git with your project (it does provide options for excluding changes, but only as an option).
Really, I normally find no need to tell git ‘update with this changed file’, ‘remove this file from your record as I’ve deleted it’ etc.
I’d really rather not experiment over time with it, and would hope this question has a simple designed-to-work answer.
Thanks in advance,
Matan
Nice and simple as a single
addcommand:Note that
git add .is not sufficient, as.expands to “the current directory”, a.k.a. “all current files”, which means it won’t tell git about any files that no longer exist (i.e. deleted files)Alternatively, if you want to add and commit in a single step (which generally isn’t recommended) then you can
instead.
It’s worth knowing that there’s no need to “experiment over time” with these git commands, as
git helphas a lot of documentation about each of the git commands and their options.