# Git操作 ###### tags: `實用筆記` ### 下載 Git GUI介面(FORK): https://git-fork.com/ ### Git 更新標題規範:https://wadehuanglearning.blogspot.com/2019/05/commit-commit-commit-why-what-commit.html ### 下載遠端資料庫 (Clone) ``` git clone 網址 ```  ### 上傳遠端資料庫 (Push) 1. 查看本地端有無修改的檔案 `git status`   2. 新增至預上傳資料夾`git add 預上傳檔案`   3. 提交分支 (Commit) `git commit`    3. 上傳至遠地分支 (狀態為本地端要上傳的分支下,並下達以下指令) ``` git push 遠端資料庫名 遠端分支名 ```   ### 檢視當前修改檔案狀態 (Status) ``` git status ``` ### 新增分支 (Branch) * 本地分支 1 查看:`git branch ` 2 新增:`git branch 分支名` ; `git branch -b 分支名` 新建分支並切換過去 3 刪除:`git branch -d 分支名` 4 切換:`git checkout 分支名` * 遠端分支 1 新增:使用Push方式,然後分支名直接用預新增的分支名。  2 刪除:用FORK工具刪除。  ### 拉取遠定分支資料 (Pull) 在所要放至分支狀態下,打以下指令 ``` git pull 遠端檔名 遠端分支名 ``` ### 合併本地端資料 (Merge) 1. 當前位置為預合併的狀態 2. 在要合併得分支按右鍵,選擇merge  ### 修改commit檔案 1. 查看所有更改節點代碼 ``` git log --oneline ``` 2. 修改節點 * 修改剛上傳的Commit ``` git reset HEAD^ ``` ### 修改commit內容 ``` git commit --amend ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up