Handy Git commands
1.
Single line command to do git add of the list of files which are listed in git status
git add $(git status -s | awk '{print $2}')
This command utilizes git status -s
to get the short output of the current repository status. Then, it pipes the output to awk
to extract the second field (the file paths). Finally, it uses git add
to add all those files to the staging area.