# git筆記 ## 下載遠端Repositories至本地端 當到達github要下載的repository頁面後,點選綠色的code,選擇Local->SSH,並複製SSH key搭配git clone指令下載。 ```bash= git clone git@github.com:user_name/repository_name.git ``` ## 一般上傳 ```bash= git add . git commit -m "what you do" git add . ``` ## 特殊狀況 ### 無法上傳 可能是多人共編同一份repository時,有人比你早上傳新版本至github上,導致你本地的版本過舊,此時需要先將github上的最新版本拉下來本地,在上傳即可。 ```bash= git pull --rebase ``` **不建議**直接強制上傳上去 ```bash= git push -f ```