将网站上传到GitHub

问题描述:

我有一个网站项目,其中有几个文件夹和子文件夹在我的桌面上。我想将这个网站复制到GitHub。使用GitHub桌面应用时,最好的方法是什么?似乎我只能上传单个文件,但没有文件夹。将网站上传到GitHub

+0

https://try.github.io/levels/1/challenges/1 – Marty

在下面打开你的ssh和类型:

git remote add origin [Your HTTPS repository] 

如果收到请求SSH密钥错误:

cd [full project folder name] (eg ~/desktop/project1) 
git init 
git add . 
git commit -m "initial commit" 
git remote add origin [email protected]:[YourUSERNAME]/[YourREPOSITORY].git 
git push -u origin master 

步骤5可以替换为。

http://i.imgur.com/X0FDTbq.png

2种方式(虽然你应该设置它们如果可能的话):

使用命令行:

1. Create repo in github 
2. Click clone or download then copy the URL 
3. In command line,Navigate to the root of your project folder 
4. initialize: git init 
5. track files: git add . 
6. commit: git commit -m "your message/comment" 
7. add remote repository: git remote add origin 'paste the repo link' 
8. git push origin master 

使用App。

1. Create Repo on Github site 
2. On you app, click + sign, under clone tab and Find that repo, then clone 
3. Put all your files/folders inside 
4. Then Sync