错误提示:error: failed to push some refs to 'git@github.com:yangchao0718/cocos2d.git
hint: Updates were rejected because the tip of your current branch is behin
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
原因:github中的README.md文件不在本地代码目录中 解决方法:git pull --rebase origin master
码云上传项目git命令总结: git clone https://git.oschina.net/xh-lxx/xh-lxx.oschina.io.git
进入到克隆下来的文件夹,然后操作git命令
Git add .
Git commit –m “备注说明”
Git push
要求输入帐号 lxx1024
密码 81487…LOVE
上传成功
本地初始化一个项目 首先,你需要执行下面两条命令,作为 git 的基础配置,作用是告诉 git 你是谁,你输入的信息将出现在你创建的提交中。 git config --global user.name "你的名字或昵称" git config --global user.email "你的邮箱" 然后在你的需要初始化版本库的文件夹中执行: git init git remote add origin <你的项目地址> //注:项目地址形式
https://git.oschina.net/xh-lxx/xh-lxx.oschina.io.git 这样就完成了一次版本你的初始化。 如果你想克隆一个项目,只需要执行: git clone https://git.oschina.net/xh-lxx/xh-lxx.oschina.io.git 进入你已经初始化好的或者克隆项目的目录,然后执行: git pull origin master <这里需要修改/添加文件,否则与原文件相比就没有变动> git add . git commit -m "第一次提交" git push origin master