Git Basic Command
今天我想在這文章中介紹最常用到的 git 指令。我會介紹我最常用到的指令有:
- git init
- git add .
- git commit -m “message”
- git push
以上是我最常用到的。我還想介紹一些關於 git remote 等指令。
基本指令
1. git init 初始化 git
Step1: 建立一個資料夾如:$mkdir test
Step2: 進去目錄 cd test
Step3: 執行 git init
就會初始化 git。如果你下 ls-al
就可以看所有資料,會有一個 .git
隱藏檔
2. git add 把檔案進索引 index
Step1: 建立檔案 touch hello.py
Step2: 編輯檔案
- (linux) vim hello.py
- (window) notepad hello.py
就加print("hello world")
Step3: 把檔案加進索引git add .
Step4: 看 git statusgit status
他會顯示 stage