1.撤消修改

1)revert:反转提交,它就是把你的一个提交先撤消掉,但是,它跟reset不同的是,你的这次这小会留下记录,这样在你下次需要的时候,可以通过这个节点把撤消的提交恢复

zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git pull
Already up-to-date.
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ vim .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git add .
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git commit -m "test 1"
[work 4f3ab02] test
files changed, insertions(+), deletions(-)
create mode .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ vim .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git add .
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git commit -m "test 2"
[work c7bc7ce] test
files changed, insertions(+), deletions(-)
create mode .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log -
commit c7bc7ced616685852b0b225042f34c038979ade4
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar :: + test Change-Id: I68bbc606ae343b33f53747745db9f2a5ccf1bc82 commit 4f3ab0254090a54a2307b14d620f83a744d879b0
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar :: + test Change-Id: I233ee74674f6e3f054c5abe0622e85efcc83b563
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git revert 4f3ab0254090a54a2307b14d620f83a744d879b0
Finished one revert.
[work ab43af6] Revert "test 1"
files changed, insertions(+), deletions(-)
delete mode .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log -
commit ab43af6847f07d08a6c14cb211ce4007782202f5
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar :: + Revert "test 1" This reverts commit 4f3ab0254090a54a2307b14d620f83a744d879b0. commit c7bc7ced616685852b0b225042f34c038979ade4
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar :: + test Change-Id: I68bbc606ae343b33f53747745db9f2a5ccf1bc82 commit 4f3ab0254090a54a2307b14d620f83a744d879b0
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar :: + test Change-Id: I233ee74674f6e3f054c5abe0622e85efcc83b563
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ ls
.txt AndroidManifest.xml Android.mk apptests CleanSpec.mk ext MODULE_LICENSE_APACHE2 NOTICE proguard.flags res src
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ vim .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git add .
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git commit -m "test 3"
[work f4c241d] test
files changed, insertions(+), deletions(-)
create mode .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log -
commit f4c241ddb521ad85605687734addaac3887c4a4e
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar :: + test Change-Id: I0bfde2e50381d2dc1b2717c0d2d839278f1c5fc6 commit ab43af6847f07d08a6c14cb211ce4007782202f5
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar :: + Revert "test 1" This reverts commit 4f3ab0254090a54a2307b14d620f83a744d879b0. commit c7bc7ced616685852b0b225042f34c038979ade4
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar :: + test Change-Id: I68bbc606ae343b33f53747745db9f2a5ccf1bc82 commit 4f3ab0254090a54a2307b14d620f83a744d879b0
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar :: + test Change-Id: I233ee74674f6e3f054c5abe0622e85efcc83b563 commit 7cbfacb7c742ef3afbcb50e56820def5d5d2af6f
Author: wangjianhua <wangjianhua@vanzotec.cn>
Date: Tue Feb :: + modify hd action mode image of Mms Change-Id: I1856c0554d1a8824c45e547df194b4f9865f2473
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ ls
.txt .txt AndroidManifest.xml Android.mk apptests CleanSpec.mk ext MODULE_LICENSE_APACHE2 NOTICE proguard.flags res src
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git revert ab43af6847f07d08a6c14cb211ce4007782202f5
Finished one revert.
[work 153148e] Revert "Revert "test ""
files changed, insertions(+), deletions(-)
create mode .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ ls
.txt .txt .txt AndroidManifest.xml Android.mk apptests CleanSpec.mk ext MODULE_LICENSE_APACHE2 NOTICE proguard.flags res src
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$

如果你想把多次的提交转化为一次反转,可以添加参数-n

zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git revert -n c7bc7ced616685852b0b225042f34c038979ade4
Finished one revert.
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git st
# On branch work
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: .txt
#
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git revert -n f4c241ddb521ad85605687734addaac3887c4a4e
Finished one revert.
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git st
# On branch work
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: .txt
# deleted: .txt
#
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git commit -m "revert test1 and test2"
[work 69b0c2e] revert test1 and test2
files changed, insertions(+), deletions(-)
delete mode .txt
delete mode .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log -
commit 69b0c2e45258fcf33203f25444d562a9470092d7
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar :: + revert test1 and test2 Change-Id: I6563031fe059a2c5bdf3e6bfa5278849ee0e9964
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ ls
.txt AndroidManifest.xml Android.mk apptests CleanSpec.mk ext MODULE_LICENSE_APACHE2 NOTICE proguard.flags res src
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git revert 69b0c2e45258fcf33203f25444d562a9470092d7
Finished one revert.
[work bbe5a74] Revert "revert test1 and test2"
files changed, insertions(+), deletions(-)
create mode .txt
create mode .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ ls
.txt .txt .txt AndroidManifest.xml Android.mk apptests CleanSpec.mk ext MODULE_LICENSE_APACHE2 NOTICE proguard.flags res src
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ vim .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$

对于一次记录只能进行一次revert,多次连续执行是没有意义的,因为revert一次以后,这次提交的内容已经不存了

zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ vim .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git add .
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git commit -m "test4"
[work 2bc646d] test4
files changed, insertions(+), deletions(-)
create mode .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log -
commit 2bc646d2f078f3c03ab5352a13a057fccc83621d
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar :: + test4 Change-Id: Ia7dff511d77e566a3920aa4fe29331afd80ed215
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git revert 2bc646d2f078f3c03ab5352a13a057fccc83621d
Finished one revert.
[work 85ceb81] Revert "test4"
files changed, insertions(+), deletions(-)
delete mode .txt
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ ls
.txt .txt .txt AndroidManifest.xml Android.mk apptests CleanSpec.mk ext MODULE_LICENSE_APACHE2 NOTICE proguard.flags res src
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git revert 2bc646d2f078f3c03ab5352a13a057fccc83621d
Finished one revert.
# On branch work
nothing to commit (working directory clean)

2)历史记录重排序

zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log --pretty=oneline -
c8edf2bebf0bea0906a09d277ad0f1007a791e36 test5
35a249e2cc2acf11a078e28381aee80f602aa64a Revert "test4"
2bc646d2f078f3c03ab5352a13a057fccc83621d test4
bbe5a74e8e0fa135577b1e5dd9554d9e49c90caf Revert "revert test1 and test2"
69b0c2e45258fcf33203f25444d562a9470092d7 revert test1 and test2
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git rebase -i 69b0c2e45258fcf33203f25444d562a9470092d7
Successfully rebased and updated refs/heads/work.
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log --pretty=oneline -
a3dfb66a35509f72ed9606a3614ed0b660c082d0 Revert "revert test1 and test2"
3b850bebefe0b6005845d534875e2d198a879af9 test5
47e439085f53260c1e0d88a6c17370d0a8437aa6 Revert "test4"
bcf6a96ef4dba4ee819ce357864911aa60458ae7 test4
69b0c2e45258fcf33203f25444d562a9470092d7 revert test1 and test2
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$

执行了git rebase -i 69b0c2e45258fcf33203f25444d562a9470092d7  命令以后,你会发现如下界面

  1 pick bcf6a96 test4
2 pick 47e4390 Revert "test4"
3 pick 3b850be test5
4 pick a3dfb66 Revert "revert test1 and test2"
5
6 # Rebase 69b0c2e..a3dfb66 onto 69b0c2e
7 #
8 # Commands:
9 # p, pick = use commit
10 # r, reword = use commit, but edit the commit message
11 # e, edit = use commit, but stop for amending
12 # s, squash = use commit, but meld into previous commit
13 # f, fixup = like "squash", but discard this commit's log message
14 #
15 # If you remove a line here THAT COMMIT WILL BE LOST.
16 # However, if you remove everything, the rebase will be aborted.
17 #

你更改pick的顺序,就决定了历史记录的顺序

3)多个提交压合一个

zhangshuli@zhangshuli-MS-7817:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log --pretty=oneline -3
f10a4b93c8bbc834b644295ea2341cd6690bf954 test5
954ba575dc29decdb4642d83421dcf3c7cfe2192 Revert "test4"
bcf6a96ef4dba4ee819ce357864911aa60458ae7 test4
zhangshuli@zhangshuli-MS-7817:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git rebase -i bcf6a96ef4dba4ee819ce357864911aa60458ae7
[detached HEAD 20ac46d] Revert "test4"
4 files changed, 3 insertions(+), 1 deletions(-)
create mode 100644 2.txt
create mode 100644 3.txt
delete mode 100644 4.txt
create mode 100644 branch.txt
Successfully rebased and updated refs/heads/work.
zhangshuli@zhangshuli-MS-7817:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log --pretty=oneline -3
20ac46dd92113d8c40b33cb91402f6025551bef2 Revert "test4"
bcf6a96ef4dba4ee819ce357864911aa60458ae7 test4
69b0c2e45258fcf33203f25444d562a9470092d7 revert test1 and test2
zhangshuli@zhangshuli-MS-7817:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log --stat 20ac46dd92113d8c40b33cb91402f6025551bef2
commit 20ac46dd92113d8c40b33cb91402f6025551bef2
Author: zhangshuli <zhangshuli@vanzotec.cn>
Date: Mon Mar 2 16:22:06 2015 +0000 Revert "test4" This reverts commit 2bc646d2f078f3c03ab5352a13a057fccc83621d. Revert "revert test1 and test2" This reverts commit 69b0c2e45258fcf33203f25444d562a9470092d7. test5 Change-Id: I09af8b31eb2d07cba0949042e06e09b85d597b7d 2.txt | 1 +
3.txt | 1 +
4.txt | 1 -
branch.txt | 1 +
4 files changed, 3 insertions(+), 1 deletions(-)

这个其实就是在修改历史记录的基础上进行了第二次修改,如下

  1 pick f4c241d test 3
2 pick 99298bc revert test1 and test2
3 pick 3e92336 test4
4 pick dd6f1ea Revert "test4"
5
6 # Rebase ab43af6..dd6f1ea onto ab43af6
7 #
8 # Commands:
9 # p, pick = use commit
10 # r, reword = use commit, but edit the commit message
11 # e, edit = use commit, but stop for amending
12 # s, squash = use commit, but meld into previous commit
13 # f, fixup = like "squash", but discard this commit's log message
14 #
15 # If you remove a line here THAT COMMIT WILL BE LOST.
16 # However, if you remove everything, the rebase will be aborted.
17 #

修改

  1 pick f4c241d test 3
2 squash 3e92336 test4
3 pick 99298bc revert test1 and test2
4 pick dd6f1ea Revert "test4"
5
6 # Rebase ab43af6..dd6f1ea onto ab43af6
7 #
8 # Commands:
9 # p, pick = use commit
10 # r, reword = use commit, but edit the commit message
11 # e, edit = use commit, but stop for amending
12 # s, squash = use commit, but meld into previous commit
13 # f, fixup = like "squash", but discard this commit's log message
14 #
15 # If you remove a line here THAT COMMIT WILL BE LOST.
16 # However, if you remove everything, the rebase will be aborted.
17 #

结果

zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log --pretty=oneline -
dd6f1ea300a8314c76fae3854291ace572f28391 Revert "test4"
3e92336ac3044d64b17c424eba01682234b14ff4 test4
99298bc028c9f9e45cc54302a371c729c8d4dd57 revert test1 and test2
f4c241ddb521ad85605687734addaac3887c4a4e test
ab43af6847f07d08a6c14cb211ce4007782202f5 Revert "test 1"
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git rebase -i ab43af6847f07d08a6c14cb211ce4007782202f5
[detached HEAD c294d73] test
files changed, insertions(+), deletions(-)
create mode .txt
create mode .txt
Successfully rebased and updated refs/heads/work.
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$ git log --pretty=oneline -
d69bd5c2f63bf3101816263c5325507010d6f8cc Revert "test4"
35942e8e4ef640804ada6e19bc8f62364892333a revert test1 and test2
c294d73f0d977b02686712b935572c486c478201 test
ab43af6847f07d08a6c14cb211ce4007782202f5 Revert "test 1"
c7bc7ced616685852b0b225042f34c038979ade4 test
zhangshuli@zhangshuli-MS-:~/PROJECT/PROJECT_V5/32_kk_qhd_k25/packages/apps/Mms$

4)一个提交分为多个提交

这个具体有什么作用还不清出,以后遇到了再说吧

git 工具的使用总结(6)-提交合并处理的更多相关文章

  1. SVN管理工具Cornerstone之:创建分支、提交合并

      创建工程的分支: 步骤: 1.选择左下角仓库repositories中的工程名->选择trunk->点击Branch->在提示框里填写分支名称create, 2.在做上角work ...

  2. Git的纯命令操作,Install,Clone , Commit,Push,Pull,版本回退,撤销更新,分支的创建/切换/更新/提交/合并,代码冲突

    Git的纯命令操作,Install,Clone , Commit,Push,Pull,版本回退,撤销更新,分支的创建/切换/更新/提交/合并,代码冲突 这篇是接着上篇分布式版本库--Windows下G ...

  3. Myeclipse如何使用自带git工具向远程仓库提交代码

    先看一下Myeclipse自带的git工具  本人是在码云上面注册的账号,上面有项目的仓库,将仓库的项目克隆到本地之后,在myeclipse中导入该项目. 那么如何将修改后的代码再提交到码云上面? 第 ...

  4. Myeclipse如何使用自带git工具向远程仓库提交代码(转)

    Myeclipse如何使用自带git工具向远程仓库提交代码 第一步:将改动的代码标记 项目右键:team->synchronize workspace 点击确定 项目右键>add to g ...

  5. git 使用merge 对本地分支进行合并 并进行代码提交的流程

    1.只有当将修改内容commit后 该修改才完全生效,进行merge前需要将两个分支修改的内容都进行commit 2.假设本地两个分支   用于开发的分支:dev    用于同步远程仓库的分支:mas ...

  6. Git小技巧之使用Rebase命令合并提交

    想要获取更多文章可以访问我的博客 - 代码无止境. 在日常的开发过程中,我们一个功能可能会有很多次提交.而且我们公司的开发是不允许直接往公司仓库提交代码,所以需要fork到自己的仓库然后merge过去 ...

  7. Git 集成 Araxis Merge 作为比较和合并GUI工具的配置 参考自https://www.kancloud.cn/leviio/git/369125

    Git 集成 Araxis Merge Win10下修改git全部配置文件方法Git 集成 Araxis Merge 作为比较和合并GUI工具的配置 那global对应的 ,gitconfig文件在哪 ...

  8. Git详解之六 Git工具(转)

    Git 工具 现在,你已经学习了管理或者维护 Git 仓库,实现代码控制所需的大多数日常命令和工作流程.你已经完成了跟踪和提交文件的基本任务,并且发挥了暂存区和轻量级的特性分支及合并的威力. 接下来你 ...

  9. Git详解之六:Git工具

    Git 工具 现在,你已经学习了管理或者维护 Git 仓库,实现代码控制所需的大多数日常命令和工作流程.你已经完成了跟踪和提交文件的基本任务,并且发挥了暂存区和轻量级的特性分支及合并的威力.(伯乐在线 ...

  10. Git工具的使用教程

    Git 是一种版本控制工具,也叫作版本管理软件(分布式管理软件).这里介绍Git的基本使用步骤,关于 Git 更详细的介绍,读者可以参考其官方网站提供的文档. 1  安装Git 在Ubuntu系统中安 ...

随机推荐

  1. psycopg2 ImportError: DLL load failed

    setup.py install 报错  error: command 'mt.exe' failed: No such file or directory  或者 Unable to find vc ...

  2. 数据库阿里连接池 Druid配置详解以及web监控统计

    java程序很大一部分要操作数据库,为了提高性能操作数据库的时候,有不得不使用数据库连接池.数据库连接池有很多选择,c3p.dhcp.proxool等,druid作为一名后起之秀,凭借其出色的性能,也 ...

  3. 21.MFC进制转换工具

    相关代码:链接:https://pan.baidu.com/s/1pKVVUZL 密码:e3vf #include <stdlib.h> #include <stdio.h> ...

  4. Python(五) 包、模块、函数与变量作用域

    一.while循环与使用场景 CONDITION=1 while CONDITION <=5 : CONDITION +=1 print("hello") else: pri ...

  5. 对win2012 server 虚拟机hyper-V 硬盘管理,容量变更及新增硬盘

    目的:对win2012 server 虚拟机hyper-V 硬盘管理,容量变更及新增硬盘 一.压缩虚拟机硬盘容量 进入Server 2012的操作系统,打开CMD框,输入:diskmgmt.msc,回 ...

  6. 关于props default 数组/对象的默认值应当由一个工厂函数返回

    export default {props: { xAxisData: {   type: Array,   default: [] }, },这是我的代码 报错是Invalid default va ...

  7. 矩阵乘法2(codevs3147)

    题目描写叙述 Description 给出两个n*n的矩阵.m次询问它们的积中给定子矩阵的数值和. 输入描写叙述 Input Description 第一行两个正整数n,m. 接下来n行,每行n个非负 ...

  8. js插件---评分插件Rating如何使用

    js插件---评分插件Rating如何使用 一.总结 一句话总结:form下的input和a标签,input记录值,a标签显示样式 12 <form data-am-rating> 13 ...

  9. Impala与HBase整合

    不多说,直接上干货! Impala可以通过Hive外部表方式和HBase进行整合,步骤如下: • 步骤1:创建hbase 表,向表中添加数据 create 'test_info', 'info' pu ...

  10. js全局的解析与执行过程

    先看下面实例的执行结果: alert(a);//undefined alert(b);//报错 alert(f);//输出f函数字符串 alert(g);//undefined var a = 1; ...