1:前提下载好Git

2:在电脑上创建一个文件夹,打开此文件夹,单击右键—〉 git bash here

3:输入git init

完成后会在此文件夹下生成一个隐藏的.git后缀文件

4:将你的代码添加并提交到本地仓库

git add .  ----> 所有文件

或 git add 《文件名》

git commit -m "项目描述"

5:将仓库代码推到线上coding(需要先获取远程仓库地址)

git remote add origin https:// git.coding.net/用户名/项目名.git

git push origin master

问题:

需要账号和密码

2:出现如下错误

hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

方法:

1:git pull

Administrator@Jassin MINGW64 ~/Desktop/git (master)
$ git pull
warning: no common commits
remote: Counting objects: , done.
remote: Compressing objects: % (/), done.
remote: Total (delta ), reused (delta )
Unpacking objects: % (/), done.
From https://git.coding.net/dujassin/fristdemo
* [new branch] master -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull() for details. git pull <remote> <branch> If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/<branch> master

2:操作如上提示:

 git pull <remote> <branch>
$ git pull --rebase origin master
From https://git.coding.net/dujassin/fristdemo
* branch master -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: one

再:

$ git push -u origin master


 

最新文章

  1. Oracle学习笔记七 锁
  2. SQL基础之基本操作
  3. removeClass color-*
  4. HDU2955 Robberies[01背包]
  5. java 21 - 1 IO流中的字符流概述
  6. oracle 编译中一个关于clntsh 库的一个 帖子 ,收藏!
  7. VS2005上一个坑:关于pch 的 error C1023
  8. android120 zhihuibeijing 开机页面
  9. 使用iScroll和photoswipe写手机浏览图片的插件的几点经验
  10. 使用ionic与cordova(phonegap)进行轻量级app开发前的环境配置与打包安卓apk过程记录
  11. How to find configuration file MySQL uses?(转)
  12. 爬取软考试题系列之ip自动代理
  13. 分享自己使用CSS的public
  14. 使用ADO.NET查询和操作数据
  15. BZOJ3052(树上带修莫队)
  16. Testbench(转)
  17. BZOJ_2242_[SDOI2011]计算器_快速幂+扩展GCD+BSGS
  18. sql server 高可用故障转移(5)
  19. tomcat解决GET请求中文参数乱码
  20. HTTP.ResponseCode

热门文章

  1. iOS开发中的地图开发
  2. minSdk(API 21) &gt; deviceSdk(API 17)解决
  3. 【目标检测】R-CNN系列与SPP-Net总结
  4. Linux段错误及GDB Coredump调试方法
  5. UVa 11549 计算器谜题(Floyd判圈算法)
  6. GTID主从 与 传统主从复制
  7. Angular for TypeScript 语法快速指南 (基于2.0.0版本)
  8. [Vue]组件——.sync 修饰符实现对prop 进行“双向绑定”
  9. SpringMVC - 多个同名name提交与后台参数解析
  10. hadoop1.2.1伪分布模式安装教程