1. 首先,使用`git log`命令查看commit历史,确定要删除的commit的哈希值(commit hash)。 2. 然后,使用`git revert`命令撤销特定commit引入的更改,并创建一个新的commit来保存这个撤销操作。 3. 最后,使用`git push`命令将新的commit推送到远程仓库。 示例: “` // 查看commit历史 $ git log // 撤销特定commi...
$ git commit-m'第一次版本提交'[master(root-commit)d32cf1f]第一次版本提交2files changed,4insertions(+)create mode100644README create mode100644hello.php 现在我们已经记录了快照。如果我们再执行 git status: $ git status# On branch masternothing to commit(working directory clean) 以上输出说明我们...
再使用git commit命令将暂存区内容添加到本地仓库中: 提交暂存区全部内容到本地仓库中:git commit -m "message" 提交暂存区的指定文件到仓库区:git commit[file1][file2]...-m"message" 注意git commit后面的 -m 选项,要跟上描述本次提交的 message,由用户自己完成,这部分内容绝对不能省略,并要好好描述,...
changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Ex...
# x, exec <command> = run command (the rest of the line) using shell # b, break = stop here (continue rebase later with 'git rebase --continue') # d, drop <commit> = remove commit # l, label <label> = label current HEAD with a name ...
into previous commit# f, fixup <commit> = like "squash", but discard this commit's log message# x, exec <command> = run command (the rest of the line) using shell# b, break = stop here (continue rebase later with 'git rebase --continue')# d, drop <commit> = remove commit ...
squash =use commit, but meld into previous commit12# f, fixup = like"squash", but discardthiscommit's log message13# x, exec = run command (the rest of the line)usingshell14# d, drop =remove commit15#16# These lines can be re-ordered; they are executedfromtop to bottom.17#18#...
message 13 # x, exec <command> = run command (the rest of the line) using shell 14 # d, drop <commit> = remove commit 15 # l, label <label> = label current HEAD with a name 16 # t, reset <label> = reset HEAD to a label 17 # m, merge [-C <commit> | -c <commit>]...
git commit -m "my first Git repo" 如果你是第一次跑Git,那么最后一条commit指令会报如下错: 请按照上面的英文提示,添加自己的用户名和邮箱,比如我是这么做的(注:下面是我的邮箱和用户名,请换成你自己的邮箱和用户名,邮箱选择一个你在用的即可,用户名选择你喜欢的即可): git config --global user....
13 # x, exec <command> = run command (the rest of the line) using shell 14 # b, break = stop here (continue rebase later with 'git rebase --continue') 15 # d, drop <commit> = remove commit 16 # l, label <label> = label current HEAD with a name ...