#安装 $ npm install validate-commit-msg husky -D #添加package.json文件配置 "husky": { "hooks": { "commit-msg": "validate-commit-msg" } } #自定义校验格式(可选) #添加一个.vcmrc文件,配置对象如下: { "types": ["feat", "fix", "docs", "styl
git config --global alias.last'log -1 HEAD' 这样,可以轻松地看到最后一次提交信息: # 这个命令是为Git配置一个全局别名last,使每次输入git last就能显示最近一次的提交信息。git last commit 66938dae3329c7aebe598c2246a8e6af90d04646 Author: Josh Goebel <dreamer3@example.com> Date: Tue Aug 26 19:...
git commit -m"Test"--date=format:relative:'4 hours ago' 注:详细看文末 附录二 2. --date=local(or--date=iso)以ISO 8601格式显示时间戳。 --date=iso8601(or--date=rfc)以RFC 2822格式显示时间戳,通常在电子邮件中找到。 3. --date=rfc2822只显示日期而不显示时间,格式为--date=shortYYYY-MM-...
#This is the commit message#3: Add file3 #Please enter the commit messageforyour changes. Lines starting #with'#'will be ignored, and an empty message aborts the commit. # #Date: Sun Oct 11 09:37:05 2020 -0400 # #interactive rebaseinprogress; onto 436e421 #Last commandsdone(3 comma...
Git is afree and open sourcedistributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git iseasy to learnand has atiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCa...
Show short description for last commit: gitshow -s Show short description for particular commit: gitshow -s c27dce0210092a828de53b11bc676865c5ce17a2 You can view several commit messages at once using thegit logcommand. Common options:
首先用git log查看commit历史确定需要操作的commit,比如: commit0bca654809387dc226cfc4ff872f65601809f485 Author: CasiaFan<fanzongshaoxing@gmail.com>Date: Wed Aug1613:13:122017+0800fix typocommitb5bf9998e40dc165d7e3055bae47172de11225d4 Author: CasiaFan<fanzongshaoxing@gmail.com>Date: Wed Aug1610:02:...
$ git commit --amend -m "New and correct message" Simply put, thisoverwritesyour last commit with a new one. This also means that you're not limited to just editing the commit'smessage: you could also add another couple of changes you forgot. ...
ithe parent of the last commit you want to edit, which isHEAD~2^orHEAD~3. It may be easier to remember the~3because you’re trying to edit the last three commits, but keep in mind that you’re actually designating four commits ago, the parent of the last commit you want to edit:...
However, of course, there a tons of situations where youreallywant to undo that last commit. E.g. because you'd like to restructure it extensively - or even discard it altogether! In these cases, the "reset" command is your best friend: ...