第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

查看文件狀態(tài)和提交歷史

標(biāo)簽:
Git

查看文件状态

git status

1、如果所有已跟踪文件都未被更改过:

$ git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

该命令显示了当前分支 main,并且显示当前分支同远程仓库的分支没有偏离,无需提交任何内容,工作目录是干净的状态。

2、如果新建文件:

$ git status
On branch main
Your branch is up to date with 'origin/main'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        hello.js

nothing added to commit but untracked files present (use "git add" to track)

新建文件 hello.js 出现在 Untracked files 下面,说明 hello.js 未被纳入 Git 跟踪的范围。
如果想要跟踪这个文件,可以使用指令 git add hello.js, 此时再运行 git status ,会看到 hello.js 已被跟踪,处于暂存区(在 Changes to be committed 下面的文件)。

$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   hello.js

处于暂存区的文件,就意味着该文件会出现在下一次的提交中( git commit )。

3、如果修改文件:

$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   hello.js

no changes added to commit (use "git add" and/or "git commit -a")

修改文件 hello.js 出现在 Changes not staged for commit 下面,说明 hello.js 内容发生了变化,但是没有放到暂存区。
同样执行 git add hello.js,将 hello.js 的修改内容放置暂存区,此时再运行 git status

$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   hello.js

文件状态简单预览

通过 git status -sgit status --short 命令,可以得到文件状态的简单预览信息。

$ git status -s
MM hello.js # 左边的 M 表示文件被修改而且已放入暂存区;右边的 M 表示文件被修改却未放入暂存区。两个 M 则表示在工作区被修改并放入暂存区后,又在工作区中被修改,所以暂存区和工作区都有该文件被修改了的记录
M  test.js # 左边的 M 表示文件被修改而且已放入暂存区
A  test1.js # 新创建而且已跟踪的文件
?? test2.js # 新创建却未跟踪的文件

查看提交历史

$ git log
commit ca82a6dff817ec66f44342007202690a93763949
Author: zhangl <zhangl@meituan.com>
Date:   Fri Jan 26 17:11:39 2024 +0800

    changed the version number

commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7
Author: zhangl <zhangl@meituan.com>
Date:   Thu Jan 25 19:52:13 2024 +0800

    removed unnecessary test

commit a11bef06a3f659402fe7563abf99ad00de2209e6
Author: zhangl <zhangl@meituan.com>
Date:   Wed Jan 24 15:22:26 2024 +0800

    first commit

执行该指令,会按提交时间列出所有的提交历史,最后一次的提交历史排在最上面。
信息的内容分别为提交哈希值,作者的名字和电子邮件,提交时间以及提交说明。

點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
Web前端工程師
手記
粉絲
1.4萬
獲贊與收藏
860

關(guān)注作者,訂閱最新文章

閱讀免費(fèi)教程

  • 推薦
  • 評論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機(jī)會得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消