码迷,mamicode.com
首页 > 其他好文 > 详细

git 修改最后一次提交的用户名 或者 commit的内容

时间:2017-01-07 18:07:56      阅读:358      评论:0      收藏:0      [点我收藏+]

标签:branch   long   spec   write   null   reset   with   specified   strip   

 

修改git最后一次提交的命令

$ git commit --amend

 

修改git最后一次提交用户名的相关命令

git config user.name ‘wangz‘  
git config user.email ‘wangz@alib.com‘  
git commit  --amend --author=wangz

 

修改最后一次提交内容的相关文档

$ git commit --amend --help  
usage: git commit [options] [--] <pathspec>...

    -q, --quiet           suppress summary after successful commit
    -v, --verbose         show diff in commit message template

Commit message options
    -F, --file <file>     read message from file
    --author <author>     override author for commit
    --date <date>         override date for commit
    -m, --message <message>
                          commit message
    -c, --reedit-message <commit>
                          reuse and edit message from specified commit
    -C, --reuse-message <commit>
                          reuse message from specified commit
    --fixup <commit>      use autosquash formatted message to fixup specified commit
    --squash <commit>     use autosquash formatted message to squash specified commit
    --reset-author        the commit is authored by me now (used with -C/-c/--amend)
    -s, --signoff         add Signed-off-by:
    -t, --template <file>
                          use specified template file
    -e, --edit            force edit of commit
    --cleanup <default>   how to strip spaces and #comments from message
    --status              include status in commit message template
    -S, --gpg-sign[=<key id>]
                          GPG sign commit

Commit contents options
    -a, --all             commit all changed files
    -i, --include         add specified files to index for commit
    --interactive         interactively add files
    -p, --patch           interactively add changes
    -o, --only            commit only specified files
    -n, --no-verify       bypass pre-commit hook
    --dry-run             show what would be committed
    --short               show status concisely
    --branch              show branch information
    --porcelain           machine-readable output
    --long                show status in long format (default)
    -z, --null            terminate entries with NUL
    --amend               amend previous commit
    --no-post-rewrite     bypass post-rewrite hook
    -u, --untracked-files[=<mode>]
                          show untracked files, optional modes: all, normal, no. (Default: all)

 

git 修改最后一次提交的用户名 或者 commit的内容

标签:branch   long   spec   write   null   reset   with   specified   strip   

原文地址:http://www.cnblogs.com/iwangzheng/p/6259782.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!