05.git團隊協(xié)作

05.git團隊協(xié)作

一.團隊內(nèi)協(xié)作

image-20210908204402843

二.跨團隊協(xié)作

image-20210908204430133

三.GitHub操作

GitHub 網(wǎng)址:https://github.com/
Ps:全球最大同性交友網(wǎng)站谈撒,技術(shù)宅男的天堂香璃,新世界的大門酗昼,你還在等什么?
賬號 姓名 驗證郵箱
atguiguyueyue 岳不群 atguiguyueyue@aliyun.com
atguigulinghuchong 令狐沖 atguigulinghuchong@163.com
atguigudongfang1 東方不敗 atguigudongfang@163.com
注:此三個賬號為講師使用賬號,同學(xué)請自行注冊,然后三個同學(xué)為一組進行團隊協(xié)作许帐!

3.1 新建遠程倉庫

image-20210908204849198
image-20210908204911894

3.2 遠程倉庫操作

命令名稱 作用
git remote -v 查看當(dāng)前所有遠程地址別名
git remote add 別名 遠程地址 起別名
git remote rm 別名 git刪除遠程地址
git push 別名 分支 推送本地分支上的內(nèi)容到遠程倉庫
git clone 遠程地址 將遠程倉庫的內(nèi)容克隆到本地
git pull 遠程庫地址別名 遠程分支名 將遠程倉庫對于分支最新內(nèi)容拉下來后與當(dāng)前本地分支直接合并

3.2.1 創(chuàng)建遠程倉庫別名

3.2.1.1 基本語法

git remote -v 查看當(dāng)前所有遠程地址別名
git remote add 別名 遠程地址

3.2.1.2 實操
Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote add git-demo https://github.com/Jason-Vue/git-demo.git

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v
git-demo        https://github.com/Jason-Vue/git-demo.git (fetch)
git-demo        https://github.com/Jason-Vue/git-demo.git (push)

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
image-20210908210707535

3.2.2 推送本地分支到遠程倉庫

3.2.2.1 基本語法

git push 別名 分支

3.2.3 ==新版本的GitHub遠程推送新方式(需要token)==

image-20210908213857406

原因:自2021年8月13日起盾致,github不再支持使用密碼push的方式

3.2.3.1 使用Personal access token

首先主经,需要獲取token

  1. 點擊你的GitHub頭像 -> 設(shè)置 -> 開發(fā)者設(shè)置 -> Personal access tokens -> Generate new token
  2. 生成token
img

3.復(fù)制token

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

img

4.使用token進行push、pull庭惜、clone等操作(pull和clone等操作原理同push罩驻,只需替換push為pull或其他相應(yīng)的命令即可)
使用token的方式其實原理在于將原來明文密碼換為token,說白了就是token>=password护赊,之所以我這里寫了>號惠遏,是因為token的功能遠大于原來的password,相比password骏啰,token具有很多其沒有的用法节吮。
我將使用token的方法進行了細分,以滿足不同的使用要求器一。請各位根據(jù)自己的使用情況進行選擇

==token法一:直接push==

此方法每次push都需要輸一遍token课锌,很是費勁啊

# git push https://你的token@你的倉庫鏈接,我這里是我的倉庫鏈接你要改成你的
git push https://你的token@github.com/sober-orange/study.git
img
==token法二:修改remote別名==

這種方式在push的時候直接指明別名就可
如果你已經(jīng)設(shè)置過remote別名祈秕,使用如下命令

# 我這里的別名是origin
# git remote set-url 你的remote別名 https://你的token@你的倉庫地址
git remote set-url origin https://你的token@github.com/sober-orange/study.git
# 提交代碼
git push -u origin master

如果你未設(shè)置過別名渺贤,使用如下命令添加別名

# git remote add 別名 https://你的token@你的倉庫地址
git remote add origin https://你的token@github.com/sober-orange/study.git
# 提交代碼
git push -u origin master
==token法三:使用Git Credential Manager Core (GCM Core) 記住token==
git push
Username: 你的用戶名
Password: 你的token
# 記住token
git config credential.helper store
==toekn法四:使用Windows的憑據(jù)管理器==
  1. 打開憑據(jù)管理器 -> windows憑據(jù)
  2. 找到“git:https://github.com”的條目,編輯它
  3. 用token替換你以前的密碼


    img
3.2.3 token實操
Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote add git-test01 https://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@github.com/Jason-Vue/git-demo.git

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v
git-demo        https://github.com/Jason-Vue/git-demo.git (fetch)
git-demo        https://github.com/Jason-Vue/git-demo.git (push)
git-test        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@https://github.com/Jason-Vue/git-demo.git (fetch)
git-test        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@https://github.com/Jason-Vue/git-demo.git (push)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (fetch)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (push)

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git push git-test01 master
fatal: unable to access 'https://github.com/Jason-Vue/git-demo.git/': OpenSSL SSL_read: Connection was reset, errno 10054

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git push git-test01 master
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 4 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (21/21), 1.72 KiB | 160.00 KiB/s, done.
Total 21 (delta 6), reused 0 (delta 0)
remote: Resolving deltas: 100% (6/6), done.
To https://github.com/Jason-Vue/git-demo.git
 * [new branch]      master -> master
image-20210909091217219

3.2.4 Git刪除網(wǎng)絡(luò)遠程地址

git remote rm 別名

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v
git-demo        https://github.com/Jason-Vue/git-demo.git (fetch)
git-demo        https://github.com/Jason-Vue/git-demo.git (push)
git-test        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@https://github.com/Jason-Vue/git-demo.git (fetch)
git-test        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@https://github.com/Jason-Vue/git-demo.git (push)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (fetch)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (push)

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote rm git-demo

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v
git-test        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@https://github.com/Jason-Vue/git-demo.git (fetch)
git-test        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@https://github.com/Jason-Vue/git-demo.git (push)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (fetch)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (push)

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote rm git-test

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git remote -v
git-test01      https://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@github.com/Jason-Vue/git-demo.git (fetch)
git-test01      https://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@github.com/Jason-Vue/git-demo.git (push)
image-20210909092529515

3.2.5 拉取遠程庫的內(nèi)容

3.2.5.1 基本語法

git pull 遠程庫地址別名 分支

3.2.5.2 實操
Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ git pull git-test01 master
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 2), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), done.
From https://github.com/Jason-Vue/git-demo
 * branch            master     -> FETCH_HEAD
   379cbbf..7d1ed0a  master     -> git-test01/master
Updating 379cbbf..7d1ed0a
Fast-forward
 hello.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Jason@JASON MINGW64 ~/Desktop/GitTest (master)
$ cat hello.txt
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git! master分支
hello world!hello Git!
hello world!hello Git!   hot-fix分支合并
我是岳不群在線更改的代碼G朊V景啊!
image-20210909093659837
image-20210909094123701

3.2.6 克隆遠程倉庫到本地倉庫

3.2.6.1 基本語法

git clone 遠程地址

3.2.6.2 實際操作
Jason@JASON MINGW64 ~/Desktop/git-lhc
$ git clone https://github.com/Jason-Vue/git-demo.git
Cloning into 'git-demo'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 27 (delta 8), reused 20 (delta 6), pack-reused 0
Unpacking objects: 100% (27/27), done.

Jason@JASON MINGW64 ~/Desktop/git-lhc
$ cd git-demo

Jason@JASON MINGW64 ~/Desktop/git-lhc/git-demo (master)
$ ll
total 1
-rw-r--r-- 1 Jason 197121 265  9月  9 09:45 hello.txt

Jason@JASON MINGW64 ~/Desktop/git-lhc/git-demo (master)
$ cat hello.txt
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git!
hello world!hello Git! master分支
hello world!hello Git!
hello world!hello Git!   hot-fix分支合并
我是岳不群在線更改的代碼7椒隆9膛铩!

Jason@JASON MINGW64 ~/Desktop/git-lhc/git-demo (master)
$ ls
hello.txt

Jason@JASON MINGW64 ~/Desktop/git-lhc/git-demo (master)
image-20210909095120240
image-20210909095146112

小結(jié):clone 會做如下操作:

1仙蚜、拉取代碼此洲。

2、初始化本地倉庫委粉。

3呜师、創(chuàng)建別名

3.3 ==團隊內(nèi)協(xié)作==

3.3.1 選擇邀請合作者

image-20210909101037044

3.3.2 填入想要合作的人

image-20210909101019437

3.3.3 復(fù) 制 地 址 并 通 過 微 信 釘 釘 等 方 式 發(fā) 送 給 該 用 戶 , 復(fù) 制 內(nèi) 容 如 下 :

https://github.com/atguiguyueyue/git-shTest/invitations

image-20210909100952604

3.3.4 在atguigulinghuchong 這個賬號中的地址 欄 復(fù)制 收到邀請的鏈接 ,點擊接受邀請贾节。

image-20210909100926426

3.3.5 在成功之后可以在 atguigulinghuchong 這個賬號上看到 git-Test的遠程倉庫

image-20210909100902546

3.3.6 并令狐沖可以修改內(nèi)容并 push

--編輯 clone 下來的文件
Layne@LAPTOP-Layne  MINGW64  /d/Git-Space/pro-linghuchong/git-shTest
(master)
$ vim hello.txt
Layne@LAPTOP-Layne  MINGW64  /d/Git-Space/pro-linghuchong/git-shTest
(master)
$ cat hello.txt
hello git! hello atguigu!  2222222222222
hello git! hello atguigu! 33333333333333
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu! 我是最帥的汁汗,比岳不群還帥
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu!
hello git! hello atguigu! master test
hello git! hello atguigu! hot-fix test
--將編輯好的文件添加到暫存區(qū)
Layne@LAPTOP-Layne  MINGW64  /d/Git-Space/pro-linghuchong/git-shTest
(master)
$ git add hello.txt
--將暫存區(qū)的文件上傳到本地庫
Layne@LAPTOP-Layne  MINGW64  /d/Git-Space/pro-linghuchong/git-shTest
(master)
$ git commit -m "lhc commit" hello.txt
[master 5dabe6b] lhc commit
1 file changed, 1 insertion(+), 1 deletion(-)
--將本地庫的內(nèi)容 push 到遠程倉庫
Layne@LAPTOP-Layne  MINGW64  /d/Git-Space/pro-linghuchong/git-shTest
(master)
$ git push origin master
Logon failed, use ctrl+c to cancel basic credential prompt.
Username for 'https://github.com': atguigulinghuchong
Counting objects: 3, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 309 bytes | 309.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/atguiguyueyue/git-shTest.git
7cb4d02..5dabe6b master -> master

3.3.7 回到 atguiguyueyue 的 的 GitHub 遠程倉庫中可以看到,最后一次是 lhc 提交的栗涂。

image-20210909100835865
image-20210909100845358

3.4 ==跨團隊協(xié)作==

3.4.1 將遠程倉庫的地址復(fù)制發(fā)給邀請跨團隊協(xié)作的人知牌,比如東方不敗

image-20210909202433181

3.4.2 在東方不敗的 GitHub 賬號里的地址欄復(fù)制收到的鏈接,然后點擊 Fork 將項目叉到自己的本地倉庫斤程。

image-20210909202506109

叉入中…

image-20210909202524689

叉成功后可以看到當(dāng)前倉庫信息角寸。

image-20210909202540103

3.4.3 東方不敗就可以在線編輯叉取過來的文件。

image-20210909202607582
image-20210909202615348

3.4.4 編輯完畢后,填寫描述信息并點擊左下角綠色按鈕提交袭厂。

image-20210909202643682

3.4.5 接下來點擊上方的 Pull 請求墨吓,并創(chuàng)建一個新的請求。

image-20210909202707802
image-20210909202715936
image-20210909202723337

3.4.6 回到岳岳 GitHub 賬號可以看到有一個 Pull request

image-20210909202758935
image-20210909202805205

進入到聊天室纹磺,可以討論代碼相關(guān)內(nèi)容。

image-20210909202822674
image-20210909202829831

3.4.7 如果代碼沒有問題亮曹,可以點擊 Merge pull reque 合并代碼橄杨。

image-20210909202859691
image-20210909202908261

四.==SSH免密登錄==

4.1 我們可以看到遠程倉庫中還有一個 SSH 的地址,因此我們也可以使用 SSH 進行訪問照卦。

image-20210909203758078

這意味著這里沒有生成SSH的key

4.2 生成SSH公鑰和私鑰

image-20210909210834132

4.2.1 首先進入.ssh文件夾下式矫,確保里面空空如也(如不為空,則會有下面的沖突)

ssh-keygen -t rsa -C wei1396981310@163.com(github郵箱地址)

注意:這里-C 這個參數(shù)是大寫的 C

Jason@JASON MINGW64 ~/.ssh
$ ssh-keygen -t rsa -C wei1396981310@163.com
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/13969/.ssh/id_rsa):
/c/Users/13969/.ssh/id_rsa already exists.
Overwrite (y/n)?

Jason@JASON MINGW64 ~/.ssh
$

Jason@JASON MINGW64 ~/.ssh
$ ssh-keygen -t rsa -C wei1396981310@163.com
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/13969/.ssh/id_rsa):
/c/Users/13969/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/13969/.ssh/id_rsa.
Your public key has been saved in /c/Users/13969/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:A/eE61u01d4QTghPCW1bDMOEkHk4vjcIK2rghh6nCUI wei1396981310@163.com
The key's randomart image is:
+---[RSA 3072]----+
|        .=o*=+   |
|        =.o+=oo  |
|      ..oo..ooo  |
|      .o.+  .+ . |
| E     oSoo . +  |
|o   . ..oooo . o |
|=o o .  ..o.  . .|
|+oB      o       |
|o=      .        |
+----[SHA256]-----+
image-20210909211422868

4.2.2 查看公鑰和私鑰

Jason@JASON MINGW64 ~/.ssh
$ ll
total 10
-rw-r--r-- 1 Jason 197121  268  8月 17 19:37 config
-rw-r--r-- 1 Jason 197121 2610  9月  9 21:02 id_rsa
-rw-r--r-- 1 Jason 197121  575  9月  9 21:02 id_rsa.pub
-rw-r--r-- 1 Jason 197121 1117  7月 13 23:50 known_hosts

Jason@JASON MINGW64 ~/.ssh
$ cat id_rsa
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEA1ja8peDhbtvP52n5k8jmSVmWEqdQoLSVBz7g2lhSkdaF7SCaPpmF
f5/t++F+KlYijQ8Sd6PWxhooFixn7qlWMSo54GkBWTSG7Fgrhg58anRP1Cb77/WIh7UFi9
SFfvhVo87WU1r6ga/qLVrEibYAIFIpg9MJZEmqPl1KFR0WHtYVvpkGw/YvrfSbtbr5kGk9
0rgIDn7BW/IYSyxHJe1rqqscxcKeL9/MU6YEb4QD758DyvW/U5Py4d9MjB71d7l620zk55
zaNNbhLAf4CjoJM4OtB75c866LnCl+vFF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@JASON MINGW64 ~/.ssh
$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDWNryl4OFu28/nafmTyOZJWZYSp1CgtJUHPuDaWFKR1oXtIJo+mYV/n+374X4qViKNDxJ3o9bGGigWLGfuqVYxKjngaQFZNIbsWCuGDnxqdE/UJvvv9YiHtQWL1IV++FWjztZTWvqBr+otWsSJtgAgUimD0wlkSao+XUoVHRYe1hW+mQbD

vlzzroucKX68UUamSrQfBzmnsu9PWJ5BGrlT2hTrfIGMwxS1M7WAPqxHZHGdfQ1HEtvygaSiJW93YUjLFw7j+dy2wliVRQVL3ea8kS74Iv4CrvGZqV7wdr8dy+Ptb3zLiZy1OkPrlwcOTVzOngccFJ7BfOjOosUUVYtCDYO7E2g+JaT1leXCpJ+96fmToyCXL74Cnw8ergXsjJU0VRTWt85uJebehjVWtHLajv0= wei1396981310@163.com

image-20210909212002735

4.3 復(fù)制id_rsa.pub 文件內(nèi)容,登錄 GitHub,點擊用戶頭像→Settings→SSH and GPG keys

image-20210909212308183
image-20210909212320509
image-20210909212551552
image-20210909212654424

4.4 使用SSH方式

image-20210909213039152

4.4.1 用SSH的方式克隆下代碼

image-20210909213415825
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末役耕,一起剝皮案震驚了整個濱河市采转,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌瞬痘,老刑警劉巖故慈,帶你破解...
    沈念sama閱讀 216,402評論 6 499
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異框全,居然都是意外死亡察绷,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,377評論 3 392
  • 文/潘曉璐 我一進店門津辩,熙熙樓的掌柜王于貴愁眉苦臉地迎上來拆撼,“玉大人,你說我怎么就攤上這事喘沿≌⒍龋” “怎么了?”我有些...
    開封第一講書人閱讀 162,483評論 0 353
  • 文/不壞的土叔 我叫張陵蚜印,是天一觀的道長莺禁。 經(jīng)常有香客問我,道長晒哄,這世上最難降的妖魔是什么睁宰? 我笑而不...
    開封第一講書人閱讀 58,165評論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮寝凌,結(jié)果婚禮上柒傻,老公的妹妹穿的比我還像新娘。我一直安慰自己较木,他們只是感情好红符,可當(dāng)我...
    茶點故事閱讀 67,176評論 6 388
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般预侯。 火紅的嫁衣襯著肌膚如雪致开。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,146評論 1 297
  • 那天萎馅,我揣著相機與錄音双戳,去河邊找鬼。 笑死糜芳,一個胖子當(dāng)著我的面吹牛飒货,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播峭竣,決...
    沈念sama閱讀 40,032評論 3 417
  • 文/蒼蘭香墨 我猛地睜開眼塘辅,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了皆撩?” 一聲冷哼從身側(cè)響起扣墩,我...
    開封第一講書人閱讀 38,896評論 0 274
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎扛吞,沒想到半個月后呻惕,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,311評論 1 310
  • 正文 獨居荒郊野嶺守林人離奇死亡喻粹,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,536評論 2 332
  • 正文 我和宋清朗相戀三年蟆融,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片守呜。...
    茶點故事閱讀 39,696評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡型酥,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出查乒,到底是詐尸還是另有隱情弥喉,我是刑警寧澤,帶...
    沈念sama閱讀 35,413評論 5 343
  • 正文 年R本政府宣布玛迄,位于F島的核電站由境,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏蓖议。R本人自食惡果不足惜虏杰,卻給世界環(huán)境...
    茶點故事閱讀 41,008評論 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望勒虾。 院中可真熱鬧纺阔,春花似錦、人聲如沸修然。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,659評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至玻靡,卻和暖如春结榄,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背囤捻。 一陣腳步聲響...
    開封第一講書人閱讀 32,815評論 1 269
  • 我被黑心中介騙來泰國打工臼朗, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人最蕾。 一個月前我還...
    沈念sama閱讀 47,698評論 2 368
  • 正文 我出身青樓依溯,卻偏偏與公主長得像,于是被迫代替她去往敵國和親瘟则。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,592評論 2 353

推薦閱讀更多精彩內(nèi)容