Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Re-formatted & clarified section about commit signoff

...

$ git add file1.txt

# or to add all files

$ git add .

# review changes

$ git diff –cached

$ git commit -s

b.      use the git commit -a to automatically stage all tracked, modified files before the commit If you think the git add stage of the workflow is too cumbersome. This basically tells Git to run git add on any file that is "tracked" - that is, any file that was in your last commit and has been modified.  Please use caution when using this approach as it's easy to accidently commit files unintentionally (eg. build artifacts, temp files from editors, ...).

$
git commit -as

 

#

The -s option

...

used for both alternatives causes a committer signed-off-by line

...

to be appended to the end of the commit

...

message body.

...

  It

...

certifies that committer has the rights to submit

...

this work under the same license and agrees to

...

our Developer Certificate of Origin (see Contributor's Guide for more details about our DCO). E.g.

#

signed-off by: John Doe johndoe@example.com

 

# For it to be used the user’s

 In order to use the -s option, you need to make sure you configure your git name (user.name) and email address (user.email)

...

:

$ git config –global.user.name “John Doe”

$ git config –global.user.email johndoe@example.com

 

# To check

$ git config -list

...