回覆列表
  • 1 # 程式設計字典

    原文:http://codingdict.com/article/21405Git

    Tom更新了他的本地儲存庫,並在 src 目錄中找到了已編譯的二進位制檔案。在檢視提交訊息後,他意識到編譯的二進位制檔案是由Jerry新增的。

    [tom@CentOS src]$ pwd/home/tom/project/src[tom@CentOS src]$ ls Makefile string_operations string_operations.c[tom@CentOS src]$ file string_operations string_operations: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped[tom@CentOS src]$ git log commit 29af9d45947dc044e33d69b9141d8d2dad37cc62 Author: Jerry Mouse <[email protected]> Date: Wed Sep 11 10:16:25 2013 +0530 Added compiled binary

    VCS僅用於儲存原始碼,而不用於儲存可執行二進位制檔案。因此,Tom決定從儲存庫中刪除此檔案。為了進一步操作,他使用 git rm 命令。

    [tom@CentOS src]$ ls Makefile string_operations string_operations.c[tom@CentOS src]$ git rm string_operations rm "src/string_operations"[tom@CentOS src]$ git commit -a -m "Removed executable binary"[master 5776472] Removed executable binary1 files changed, 0 insertions(+), 0 deletions(-)delete mode 100755 src/string_operations

    提交後,他將更改推送到儲存庫。

    [tom@CentOS src]$ git push origin master

    上面的命令將產生以下結果。

    Counting objects: 5, done. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 310 bytes, done. Total 3 (delta 1), reused 0 (delta 0)To [email protected]:project.git 29af9d4..5776472 master −> master

  • 中秋節和大豐收的關聯?
  • 長江三峽是哪三個峽的總稱?