1. 程式人生 > >使用git 將專案從GitHub中下載,並上傳專案到GitHub

使用git 將專案從GitHub中下載,並上傳專案到GitHub

使用git 將專案從GitHub中下載,並上傳專案到GitHub

進入GitHub官網建立賬戶,並new Repository,倉庫名“Hello-World”,複製地址備用

建立並進入指定的資料夾,比如E:\study\git_study

右鍵-->Git Bash Here,出現如下

1.從GitHub上clone專案

輸入git clone https://github.com/dingxiaonan/Hello-World.git(上面複製的地址)

這個步驟完成後,E:\study\git_study會多出個資料夾

至此,成功將GitHub上的倉庫克隆到本地

2.從本地複製某專案☞Hello-World資料夾,將此專案上傳到GitHub

接著,繼續輸入命令 cd Hello-World,進入Hello-World資料夾

3.繼續輸入命令 git add .

是將Hello-World資料夾下的檔案都新增進來

4.繼續輸入命令 git commit -m "first commit"     提交資訊

5.繼續輸入命令 git push -u origin master  將本地倉庫push到GitHub上面(需進行登入操作)

至此,專案上傳成功