用户工具

站点工具


git

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
上一修订版两侧同时换到之后的修订记录
git [2020/09/01 14:24] ploughgit [2020/11/25 21:31] – [修改用户名和邮箱] plough
行 24: 行 24:
 # 列出所有子模块 # 列出所有子模块
 git submodule git submodule
 +</code>
 +
 +===== 压缩commit =====
 +[[https://blog.csdn.net/itfootball/article/details/44154121|git中利用rebase来压缩多次提交]]
 +<code>
 +git rebase -i HEAD~4
 +</code>
 +
 +===== 修改用户名和邮箱 =====
 +[[https://git-scm.com/book/zh/v2/Git-%E5%B7%A5%E5%85%B7-%E9%87%8D%E5%86%99%E5%8E%86%E5%8F%B2|Git 工具 - 重写历史]]
 +<code>
 +// 设置全局
 +git config --global user.name "Author Name"
 +git config --global user.email "Author Email"
 +
 +// 或者设置本地项目库配置
 +git config user.name "Author Name"
 +git config user.email "Author Email"
 +
 +// 修改最近一次提交的用户信息
 +git commit --amend --author="NewAuthor <NewEmail@address.com>"
 +</code>
 +
 +===== 回退到某个版本 =====
 +<code>
 +git reset --hard fae6966548e3ae76cfa7f38a461c438cf75ba965
 </code> </code>
git.txt · 最后更改: 2022/04/20 17:29 由 plough

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki