1 从github导出项目并提交更新代码
克隆一个github项目:
git remote add origin https://github.com/elitecodegroovy/PhoenixC.git
添加文件,提交注释。
git add README.md
git commit -m "first commit"
最后,提交代码。
git push -u origin master
2. 在github创建一个项目并提交本地初始化的源码
假设我已经在github上创建了一个称作PowerOfTech的项目,现在要提交本地源代码。可以按照下面命令行的步骤进行操作。
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/elitecodegroovy/PowerOfTech.git
git push -u origin master
此后,添加上传文件,只需要执行下面命令。
git add *.c
git commit -m "first commit"
git push -u origin master
升级你的本地库(repository),命令:
git pull
取代本地修改的文件,命令:
git checkout -- <filename>