1. Open "https://github.com/"
2. login
3. Click "Start a project"
點擊 "Start a project"
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3G5htxEp0NRpU_PM-P-mQ3c65SKGhJzA4-akyILqD_FOHjlIJ03Xs9sohUFY9h1JXaEDRFOUQ-kUmuGKgx0IhNnq_52nnlVTM60dwXKb3k3_syQhlpX7VXgGRtGdUf_taqvZv7JlnCAQ/s640/2017-06-28_135613.png)
4. name your repository and click "Create repository"
填上你的repository 名稱然後點擊 "Create repository"
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDlmXMYSDKbdt3mX9vebwEq_XAxSKoJbJ_Vt9c5jcNU2UyeobJoJfVBplTDAiGQWHgh7LCs_R6zYCL71fck66PjMvXWIeYG2ScbLteSyH6K27qFuU79-6kTNmCssdYh0bPvYrhXnI9_so/s640/2017-06-28_135728.png)
5. It redirect to your repository as below image
5.1 Click "Clone or download" 點擊 "Clone or download"
5.2 Copy "HTTPS"'s the web URL 複製 "HTTPS"的Web URL
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifmbqQoxfWDLfpe2eX8zDdHXSy6NIQL7NxPOxpPm3CpHjV85I5TF8QYN0hI-5NlfY1ndIJc7C_kPgpTn46nXh0ueUuuB-kxljXEXhABrICFGZ41iUSmqdhqZdp7pD59oztVV1IqD0QxLg/s640/2017-06-28_135920.png)
example :https://github.com/kennethhutw/AspNetCoreMvcToDoApp.git
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGorFEkR9cTt2P8h6fm-cfFlDl25aD0m0s8Zvpn3lOXirNL3hx2QOdlA6RjhvFUzeYppUbtsWlx1Y-PizGQTSusz22XOOwIVPOFZsN2RijZuixQhK8SaHWfT3NcyiHBNBOvq4FM7HMmDY/s400/2017-06-28_140059.png)
PS: if it is not HTTPS, please click "Use HTTPS" 如果不是HTTPS ,請點擊旁邊的 "Use HTTPS" 如圖下
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMMMi8EKYJUrNcmvux0bLL2rdhzaHAz5ngyO-k7ik_i_N8BkQMiPSoVXAwdvIqjJpJ-6c0U8SxFOGuYIsCX5Hz9NnKJUPanavFo6Os9fJcAUmK2zeBQSQoxJZnLZuOw_NkzI3sxR2aDqk/s320/2017-06-28_140013.png)
6. open your command line on windows 打開你的"命令行"
Type
git clone
, and then paste the URL you copied in Step 5.git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
7. Press Enter. Your local clone will be created. 按"Enter" 會複製與建立本地repository
git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY Cloning into `Spoon-Knife`... remote: Counting objects: 10, done. remote: Compressing objects: 100% (8/8), done. remove: Total 10 (delta 1), reused 10 (delta 1) Unpacking objects: 100% (10/10), done.
reference URL - https://help.github.com/articles/cloning-a-repository/
8. The repository folder is created on your path.
repository 資料夾會建立在你的路徑上
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqj4nA2EmcrH52NfFaczpwl7p7d-eqH-J2yp2tB5KXiYRL0O2rLzbAEh8Rld6i-HvI5zP7kw8aZGnI34Vp-KEZLkd3IrRgZHsYBQCiQyHbfWhcEF2NM0-KaW1eD9is_I_RgMxiKe92FL8/s400/2017-06-28_141027.png)
9. Type
cd YOUR-REPOSITORY
, and Type git status
check your repository![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjyQWLmXVoByRyNlPSS09IVT-Fp278s6d2naBJ8srxp6OAxUtJRDDSP9pgIe-sieAWvLukUbRjMElxeU4QdYdLCyhh9HBgvgYwrVVSlxGrvg02sZwJ1O1XZ_UKkUXn6dyeAdIsObJEuyE/s640/2017-06-28_141607.png)
10. Add the files in your new local repository. This stages them for the first commit.
git add . # Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'.
11. Commit the files that you've staged in your local repository.
git commit -m "First commit" # Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkwDQGsQArH3pC_C6r43JlrndJoPbWa0DkdU9qQVJf1wlsIOURN9Lr_heWrnRpp3yaYb6PVMvBEoaWGErPtgUvIoLjllibpqM_wbC0OEx6Boz8FdDGHGwBpqIFPkgbOHN3DvctZeWa6ik/s640/2017-06-28_142218.png)
12 Type
Git remote -v
, check your remote. If it does not exist, please add a remote![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNF8KyyrwAvf7sS8Yn2p0HgcGIeTuSYW0BSPThMDfLzcMRd_pbBmcwyoTfSlqCVexsskL4hRtOtfnvOYHn1e7YnMeQ8CYwdhWXtqqsAWVByGiWl44lOIerCMKSxmiFLzcNPhquahjWFPE/s640/2017-06-28_142254.png)
For example:
git remote add origin https://github.com/user/repo.git # Set a new remote git remote -v # Verify new remote origin https://github.com/user/repo.git (fetch) origin https://github.com/user/repo.git (push)
13. Push the changes in your local repository to GitHub.
git push origin master # Pushes the changes in your local repository up to the remote repository you specified as the origin
No comments:
Post a Comment