[TOC] --- ## SourceTree 下載連結 https://www.sourcetreeapp.com/  --- ## SourceTree 安裝 點擊剛下載的檔案     --- ## SourceTree 創建Local專案   --- ## Git Create SSH key 打開SourceTree上的Terminal  查看Git指令是否有效 ``` terminal git --version ```  ``` terminal ssh-keygen -t rsa -C "自訂字串" ```  全部直接按Enter  --- ## Gitlab SSH key 設定 ``` terminal cat /c/Users/${username}/.ssh/id_rsa.pub ```  複製完後 登入Gilab設定SSH key  將剛剛都字串複製到 Key裡面後 Add key  --- ## SourceTree SSH key & Remote 設定         --- ## 建立分支    --- ## 切換分支 需確認是否有異動檔案,若有異動會造成無法切換 點擊要切換之分支  詢問是否要將異動項目移至要切換的分支,或是打勾Clean(清除所有異動)  切換成功且無清除異動,可於 File Status 查看  --- ## Commit 確認commit之分支,Unstaged files 移至 Staged files 輸入下方  填寫內容並點擊Commit  --- ## Push    --- ## Fetch & Pull 點擊Fetch取得最新異動紀錄,若有向下箭頭,代表有資料須更新  點擊Pull更新至最新紀錄  --- ## Merge & Pull 點擊要Merge之分支,Merge into current branch  點擊Pull更新至最新紀錄  --- ## Merge Conflicts  發生衝突,須解決衝突再commit   --- ## Reverse commit 取消此次的 Commit =>[再做一個新的 Commit,來取消你不要的 Commit]    --- ## Reset 想要退 Commit,就在想要去的 Commit 上按滑鼠右鍵,選擇「Reset master to this commit」  Soft:將退回commit的紀錄存於staged files,本身尚未commit的異動不變 Mixed:將 staged files 退回 unstaged files,再將unstaged files 與 Reset files 混合 Hard:此commit之後的所有紀錄清除    --- ## Cherry Pick 某個分支的某幾個 Commit     --- ## Rebase 用來整理、編輯還沒有推出去的 Commit   與前一筆commit合併  勾選Amend Commit 需改寫Message內容   改寫後送出,僅剩一筆新的COMMIT  
×
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