android Studio Git命令--解决冲突和产看提交内容,移动应用开发专业前景分析

显示Sample

commit6305aa81a265f9316b606d3564521c43f0d6c9a3

Author:XXX

Date:   Thu Nov 3 11:38:15 2011 +0800

fillauthor information in the head of files and format some code

commit8e8a4a96e134dab8f045937efee35bd710006946

Author:XXX

Date:   Thu Nov 3 04:05:34 2011 +0800

usermanagement is mostly complete

details:

add support for account disable/enable

rewrite most related views to suit the above need

provide two decorators for access control (see README)

fixed many errors in Milestone 1

commit2870cd564371d8ad043d0da426a5770d36412421

Author:XXX

Date:   Mon Oct 17 20:19:04 2011 -0400

fixthe bug of get_ori_url_from_shorturl().

commitb6cdd881a19ecaff838d5825c3a6b7058fdd498a

Author:XXX

Date:   Mon Oct 17 20:17:37 2011 -0400

fixthe bug of get_article_from_short_url.

仅仅想看最后一次的提交

对应命令参数-n1

显示****Sample

commit6305aa81a265f9316b606d3564521c43f0d6c9a3

Author: XXX

Date:Thu Nov 3 11:38:15 2011 +0800

fillauthor information in the head of files and format some code

想看到最近一次提交所有更改过的文件


对应命令 gitlog -n 1 --stat

显示Sample

commit6305aa81a265f9316b606d3564521c43f0d6c9a3

Author:XXX

Date:   Thu Nov 3 11:38:15 2011 +0800

fillauthor information in the head of files and format some code

Site/accounts/decorators.py                       |    2±

Site/accounts/forms.py                            |    1+

Site/accounts/models.py                           |    1+

Site/accounts/readme                              |    3+±

Site/accounts/templates/account_activate.html     |    1+

Site/accounts/templates/account_disabled.html     |    1 +

28files changed, 37 insertions(+), 8 deletions(-)

想看到最近一次提交所有更改的细节


对应命令 gitlog -n 1 -p

显示Sample

commit6305aa81a265f9316b606d3564521c43f0d6c9a3

Author:XXX

Date:   Thu Nov 3 11:38:15 2011 +0800

fillauthor information in the head of files and format some code

diff–git a/Site/accounts/decorators.pyb/Site/accounts/decorators.py

index 22522bc…a6bb440100755

— a/Site/accounts/decorators.py

+++b/Site/accounts/decorators.py

@@ -1,9 +1,9@@

#!/usr/bin/env python

# -*- coding: utf-8-*-

+# author: Rex Nov. 3, 2011

from functoolsimport wraps

from django.core.urlresolvers importreverse

from django.http import HttpResponseRedirect

-fromdjango.utils.decorators import available_attrs

fromSite.accounts.models import UserProfile

deflogin_required(view_func):

diff --gita/Site/accounts/forms.py b/Site/accounts/forms.py

index016710b…778d92a 100755

— a/Site/accounts/forms.py

+++b/Site/accounts/forms.py

@@ -1,5 +1,6 @@

#!/usr/bin/envpython

# -*- coding: utf-8 -*-

+# author: Rex Nov.3, 201

1.git log

如果不带任何参数,它会列出所有历史记录,最近的排在最上方,显示提交对象的哈希值,作者、提交日期、和提交说明。如果记录过多,则按Page Up、Page Down、↓、↑来控制显示;按q退出历史记录列表。git log命令后的例子:

commit6305aa81a265f9316b606d3564521c43f0d6c9a3

Author:XXX

Date:   Thu Nov 3 11:38:15 2011 +0800

fillauthor information in the head of files and format some code

commit8e8a4a96e134dab8f045937efee35bd710006946

Author:XXX

Date:   Thu Nov 3 04:05:34 2011 +0800

usermanagement is mostly complete

details:

add support for account disable/enable

《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》

【docs.qq.com/doc/DSkNLaERkbnFoS0ZF】 完整资料开源分享

rewrite most related views to suit the above need

provide two decorators for access control (see README)

fixed many errors in Milestone 1

commit2870cd564371d8ad043d0da426a5770d36412421

Author:XXX

Date:   Mon Oct 17 20:19:04 2011 -0400

fixthe bug of get_ori_url_from_shorturl().

commitb6cdd881a19ecaff838d5825c3a6b7058fdd498a

Author:XXX

Date:   Mon Oct 17 20:17:37 2011 -0400

fixthe bug of get_article_from_short_url.

2.git log -n

如果不想向上面那样全部显示,可以选择显示前N条。

想看到最近一次提交所有更改过的文件


git -n 1

显示Sample

commit6305aa81a265f9316b606d3564521c43f0d6c9a3

Author: XXX

Date:Thu Nov 3 11:38:15 2011 +0800

fillauthor information in the head of files and format some code


3.git log --stat -n

显示简要的增改行数统计,每次提交文件的变更统计,-n 同上,前n条,可省略。

$ git log --stat -2

commit d0b9a20fac8abc7517c5a04c0fbb1d488f309bf5

Author: BeginMan pythonsuper@gmail.com

Date: Sat Mar 1 23:26:43 2014 +0800

ok

_posts/2014-02-27-Customizing-Git.md | 5 +++++

1 file changed, 5 insertions(+)

commit 8c186cd71492b7a3eae6df7de880b99efa0f87cf

Author: BeginMan pythonsuper@gmail.com

Date: Sat Mar 1 23:26:10 2014 +0800

mi

_posts/2014-02-27-Customizing-Git.md | 56 ++++++++++++++++++++++++++++++++++±

1 file changed, 55 insertions(+), 1 deletion(-)

每个提交都列出了修改过的文件,以及其中添加和移除的行数,并在最后列出所有增减行数小计,比如上面的有5行做了更新。

4.git log -p -n

此命令同上,不过显示更全了。

5.git log --pretty=oneline

一行显示,只显示哈希值和提交说明。

6.gig lot --graph

ASCII 字符串表示的简单图形,形象地展示了每个提交所在的分支及其分化衍合情况

$ git log --pretty=format:"%h %s" --graph

7.$ git log --pretty=format:" "

控制显示的记录格式,常用的格式占位符写法及其代表的意义如下:

选项 说明

%H 提交对象(commit)的完整哈希字串

%h 提交对象的简短哈希字串

%T 树对象(tree)的完整哈希字串

%t 树对象的简短哈希字串

%P 父对象(parent)的完整哈希字串

%p 父对象的简短哈希字串

%an 作者(author)的名字

%ae 作者的电子邮件地址

%ad 作者修订日期(可以用 -date= 选项定制格式)

%ar 作者修订日期,按多久以前的方式显示

%cn 提交者(committer)的名字

%ce 提交者的电子邮件地址

%cd 提交日期

%cr 提交日期,按多久以前的方式显示

%s 提交说明

如下操作:

$ git log --pretty=format:"%h -%an,%ar : %s" -3

d0b9a20 -BeginMan,24 hours ago : ok

8c186cd -BeginMan,24 hours ago : mi

b2a3100 -BeginMan,24 hours ago : what?

显示了前3条的信息,简单的哈希值,作者,提交时间,提交说明。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值