Latest web development tutorials

Git ดูประวัติการส่ง

Git ดูประวัติการส่ง

หลังจากที่ใช้ Git ส่งจำนวนของการปรับปรุงหรือโคลนรายการที่จะส่งประวัติภายใต้การตรวจสอบเราสามารถใช้คำสั่งเข้าสู่ระบบคอมไพล์

สำหรับการดำเนินงานส่วนก่อนหน้านี้ของเราเป็นคำสั่ง log Git เพื่อรายการประวัติของระเบียนส่งดังนี้

$ git log
commit 88afe0e02adcdfea6844bb627de97da21eb10af1
Merge: 14b4dca d7e7346
Author: w3cschool <[email protected]>
Date:   Sun Mar 1 15:03:42 2015 +0800

    Merge branch 'change_site'
    
    Conflicts:
        test.txt

commit 14b4dcadbdc847207651d5a9fae0d315057f346e
Author: w3cschool <[email protected]>
Date:   Sun Mar 1 14:53:15 2015 +0800

    新增加一行

commit d7e734640da06055e107eaf29cf350b3f1de1c2c
Author: w3cschool <[email protected]>
Date:   Sun Mar 1 14:48:57 2015 +0800

    changed the site

commit 556f0a0637978097b82287ac665a717623b21f3f
Author: w3cschool <[email protected]>
Date:   Sun Mar 1 14:40:34 2015 +0800

    removed test2.txt

เราสามารถใช้ตัวเลือก --oneline เพื่อดูประวัติของรุ่นขนาดกะทัดรัด

$ git log --oneline
88afe0e Merge branch 'change_site'
14b4dca 新增加一行
d7e7346 changed the site
556f0a0 removed test2.txt
2e082b7 add test2.txt
048598f add test.txt
85fc7e7 test comment from w3cschool.cc

นี้บอกเราว่าประวัติศาสตร์ของการพัฒนาของโครงการนี้

นอกจากนี้เรายังสามารถใช้ตัวเลือก --graph เพื่อดูประวัติของสิ่งที่เกิดขึ้นเมื่อการควบรวมกิจการสาขา นี่คือคำสั่งเดียวกันเปิดตัวเลือกโครงสร้าง:

$ git log --oneline --graph
*   88afe0e Merge branch 'change_site'
|\  
| * d7e7346 changed the site
* | 14b4dca 新增加一行
|/  
* 556f0a0 removed test2.txt
* 2e082b7 add test2.txt
* 048598f add test.txt
* 85fc7e7 test comment from w3cschool.cc

ตอนนี้เราสามารถมองเห็นเข้าใจได้อย่างชัดเจนมากขึ้นเมื่อแฉกทำงานและเมื่อผสาน

นอกจากนี้คุณยังสามารถใช้เข้าสู่ระบบเพื่อแสดงทั้งหมด 'กลับ --reverse' พารามิเตอร์

$ git log --reverse --oneline
85fc7e7 test comment from w3cschool.cc
048598f add test.txt
2e082b7 add test2.txt
556f0a0 removed test2.txt
d7e7346 changed the site
14b4dca 新增加一行
88afe0e Merge branch 'change_site'

หากคุณต้องการที่จะหาบันทึกผู้ใช้ที่ระบุสามารถส่งโดยใช้คำสั่ง: เข้าสู่ระบบ --author Git ตัวอย่างเช่นสมมติว่าเรากำลังมองหาส่วน Git Source Code Linus ส่ง:

$ git log --author=Linus --oneline -5
81b50f3 Move 'builtin-*' into a 'builtin/' subdirectory
3bb7256 make "index-pack" a built-in
377d027 make "git pack-redundant" a built-in
b532581 make "git unpack-file" a built-in
112dd51 make "mktag" a built-in

หากคุณต้องการที่จะระบุวันที่ที่คุณสามารถทำได้หลายตัวเลือก: - ตั้งแต่และ --before แต่คุณยังสามารถใช้ --until และ --after

ตัวอย่างเช่นถ้าผมต้องการที่จะดูโครงการ Git สามสัปดาห์ที่ผ่านมาและทั้งหมดที่ส่งหลังวันที่ 18 เมษายนและฉันสามารถทำเช่นนี้ (ผมยังใช้ตัวเลือกที่จะซ่อนผสานกระทำ --no-ผสาน):

$ git log --oneline --before={3.weeks.ago} --after={2010-04-18} --no-merges
5469e2d Git 1.7.1-rc2
d43427d Documentation/remote-helpers: Fix typos and improve language
272a36b Fixup: Second argument may be any arbitrary string
b6c8d2d Documentation/remote-helpers: Add invocation section
5ce4f4e Documentation/urls: Rewrite to accomodate transport::address
00b84e9 Documentation/remote-helpers: Rewrite description
03aa87e Documentation: Describe other situations where -z affects git diff
77bc694 rebase-interactive: silence warning when no commits rewritten
636db2c t3301: add tests to use --format="%N"

เข้าสู่ระบบ Git คำสั่งเพิ่มเติมเพื่อดู: http://git-scm.com/docs/git-log