- 初始化项目
首先,你需要执行下面两条命令,作为 git 的基础配置,作用是告诉 git 你是谁,你输入的信息将出现在你创建的提交中。
git config --global user.name "你的名字或昵称"
git config --global user.email "你的邮箱"
cd project
git init
git remote add origin <你的项目地址> //注:项目地址形式为:http://git.oschina.net/xxx/xxx.git或者 git@git.oschina.net:xxx/xxx.git
- 提交
git pull origin master
<这里需要修改/添加文件,否则与原文件相比就没有变动>
git add .
git commit -m "第一次提交"
git push origin master