一、上传文件
1. 右键要上传的项目,选择git bash here。
2. 初始化git项目文件夹。
git init
3. 将网站上的原有项目clone至本地仓库
git clone https://github.com/xxxx/xxxx.git
或者
git clone git@github.com:xxxx/xxxx.git
4. 将项目所有文件添加至仓库
单个文件添加
git add 文件名
整个文件夹添加
git add .
5. 提交项目文件至仓库
git commit -m "项目说明"
6. push至github
git push -u
二、生成ssh密钥
1. 在cmd命令行或Git Bash输入
ssh-keygen -t rsa -C "your email"
2. 至C盘用户文件夹寻找.ssh文件夹,打开id.rsa.pub文件复制其中的内容。
3. github网页头像-->Settings-->SSH and GPG Keys-->SSH Keys-->New SSH key。Title随便取,Key框粘贴刚复制的内容
三、更新文件
1. 获取最新项目
git pull --rebase origin master
2. push回去
git push -u