当前位置: 首页 > news >正文

使用git将代码推到coding

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: 5, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 5 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (5/5), 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(1) 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

 

 
 

 

 

 

转载于:https://www.cnblogs.com/jassin-du/p/9404128.html

相关文章:

  • 理解在java “”i=i++;”所发生的事情
  • HDU 6342 Expression in Memories(模拟)多校题解
  • eclipse 更换国内镜像
  • @angular/forms 源码解析之双向绑定
  • C# 获取电脑的网络连接状态
  • leetcode 有效的字母异位词 java 版本
  • memset函数,strcpy函數,memcp函數
  • 老司机 iOS 周报 #30 | 2018-08-06
  • 机器学习 -- 机器学习是什么?
  • TCP三次握手四次挥手手动实践
  • 初识 Spring(05)---(Annotation注解)
  • win7系统已经够用为什么还要开发win10系统
  • python3 简单爬虫
  • HAP将新的页面加入到菜单
  • 常用的CSS各类属性
  • 《用数据讲故事》作者Cole N. Knaflic:消除一切无效的图表
  • Angular数据绑定机制
  • C++回声服务器_9-epoll边缘触发模式版本服务器
  • crontab执行失败的多种原因
  • Essential Studio for ASP.NET Web Forms 2017 v2,新增自定义树形网格工具栏
  • java 多线程基础, 我觉得还是有必要看看的
  • mysql中InnoDB引擎中页的概念
  • vue:响应原理
  • vue2.0开发聊天程序(四) 完整体验一次Vue开发(下)
  • 编写符合Python风格的对象
  • 代理模式
  • 给github项目添加CI badge
  • 快速构建spring-cloud+sleuth+rabbit+ zipkin+es+kibana+grafana日志跟踪平台
  • 自制字幕遮挡器
  • MiKTeX could not find the script engine ‘perl.exe‘ which is required to execute ‘latexmk‘.
  • 【云吞铺子】性能抖动剖析(二)
  • ###STL(标准模板库)
  • (html5)在移动端input输入搜索项后 输入法下面为什么不想百度那样出现前往? 而我的出现的是换行...
  • (转)iOS字体
  • .a文件和.so文件
  • .net Application的目录
  • .net core 3.0 linux,.NET Core 3.0 的新增功能
  • .Net Core和.Net Standard直观理解
  • .Net Memory Profiler的使用举例
  • .NET Remoting学习笔记(三)信道
  • .NET 反射 Reflect
  • .NET(C#) Internals: as a developer, .net framework in my eyes
  • /usr/bin/perl:bad interpreter:No such file or directory 的解决办法
  • @ConfigurationProperties注解对数据的自动封装
  • @hook扩展分析
  • @property @synthesize @dynamic 及相关属性作用探究
  • [ 云计算 | AWS 实践 ] 基于 Amazon S3 协议搭建个人云存储服务
  • [20150629]简单的加密连接.txt
  • [20171101]rman to destination.txt
  • [C/C++]数据结构----顺序表的实现(增删查改)
  • [c++] 什么是平凡类型,标准布局类型,POD类型,聚合体
  • [CentOs7]搭建ftp服务器(2)——添加用户
  • [echarts] y轴不显示0
  • [Eclipse] 详细设置护眼背景色和字体颜色并导出
  • [hdu4622 Reincarnation]后缀数组