concept command in category git

appears as: commd, command, commds, commd, commds
Git in Practice

This is an excerpt from Manning's book Git in Practice.

All git commands referenced in this book have complete references to all their possible syntax and arguments in Git’s help. This can be accessed for a given command by running the command suffixed with --help: for example, git init --help. This book will cover only the most common and useful commands and arguments.

Technique 55 Running a command in every submodule: git submodule foreach

Sometimes you may wish to perform a command or query in every submodule. For example, you may want to iterate through all the submodules in a repository (and their submodules) and run a Git command to ensure that they have all checked out the master branch and have fetched the latest remote repository commits or print status information. Git provides the git submodule foreach command for this case: it takes a command (or commands) as an argument and then iterates through each Git submodule (and their submodules) and runs the same command.

Listing 12.1. Good commit message format
Commits: first line is a summary (<51 characters). Commit messages should be structured like emails. The first line (the commit subject) should be treated like the subject of an email. It should make a brief summary that is elaborated on in the rest of the commit message. It should have 50 characters or fewer and always be separated by a new line from the rest of the commit message body. Without this new line, various output formats that try to display only the first line of the commit may get confused. The commit's message body can be split into multiple paragraphs which should be wrapped at 72 characters or fewer. The wrapping is done to ensure the output of tools like `git log` remains readable even when it adds indentation for diffs. Otherwise the commit message has no other limits on length; it should be as long as it needs to be to fully explain the commit. While the subject might describe what the commit does, the body should expand on why the change was made. It should also use the present tense to match the tense used by commit messages generated by commands such as git merge. If you're using GitHub (and some other tools) then the contents of commit messages can contain Markdown. You may use Markdown to add some formatting that looks good in ASCII or rendered such as using **bold**, _italics_, ~~strikethrough~~, `monospace` or lists bulleted with a `*` or numbered with, for example `1.`. You shouldn't go overboard with this but it can add some useful, basic formatting.