diff --git a/snippets/commit-set-author.md b/snippets/commit-set-author.md new file mode 100644 index 000000000..337e7d903 --- /dev/null +++ b/snippets/commit-set-author.md @@ -0,0 +1,20 @@ +--- +title: Create a commit by a different author +tags: commit,intermediate +--- + +Creates a new commit by the specified author. + +- Use `git commit -m ` to create a new commit with the specified ``. +- Use the `--author` option to change the `` and `` of the commit's author. + +```sh +git commit -m --author=" " +``` + +```sh +# Make some changes to files +git add . +git commit -m "Fix the network bug" --author="Duck Quackers " +# Creates a commit by `Duck Quackers` +```