git 上传代码到码云

与码云建立连接教程:http://blog.csdn.net/zengmingen/article/details/76045076


如果完成了上面步骤的,且有了git。上传项目步骤:


代码提交

代码提交一般有五个步骤:

1.查看目前代码的修改状态

2.查看代码修改内容

3.暂存需要提交的文件

4.提交已暂存的文件

5.同步到服务器


1.     查看目前代码的修改状态

提交代码之前,首先应该检查目前所做的修改,运行Git status命令

a)        已暂存 (changes to be committed)


new file //表示新建文件

modified //表示修改文件

deleted //表示删除文件

b)       已修改 (changed but not updated)

modified //表示修改文件

deleted //表示删除文件

另外,git 给出了可能需要的操作命令,git add/rm, gitcheckout --

c)        未跟踪 (untracked files)

      

      

2.     查看代码修改的内容

 git diff  <file>

比较某文件与最近提交节点的差异。

注意:如果该文件已暂存,那么应该使用git diff –cached<file>
 

 git diff <hashcode> <hashcode>  <file>

比较某文件在提交节点a,节点b的差异。

技巧:如果省略后面一个hashcode,则默认表示与上一提交节点比较。(也可以利用^运算符)

 

3.     暂存需要提交的文件


如果是新建的文件

则git add  <file>


如果是修改的文件
则git add  <file>

如果是删除的文件
则 git rm  <file>


4.     提交已暂存的文件

git commit

注意注释填写规范。

git commit --amend

修改最近一次提交。有时候如果提交注释书写有误或者漏提文件,可以使用此命令。


5.     同步到服务器

同步到服务器前先需要将服务器代码同步到本地

命令: git pull

如果执行失败,就按照提示还原有冲突的文件,然后再次尝试同步。

命令:git checkout -- <有冲突的文件路径>

同步到服务器

命令: git push origin  <本地分支名>

如果执行失败,一般是没有将服务器代码同步到本地导致的,先执行上面的git pull命令。





操作例子:


复制这行代码,到你本地,找个文件夹,开始clone吧

#cd ~/gitosproject
#git clone git@git.oschina.net:ifengye/test.git

看到这行,说明远程仓库的代码已经被clone下来啦!

#cd test

下面开始撸代码吧,啪啪啪啪啪啪啪啪,好了,撸完了,我们来提交我们的代码哈~

提交项目

一个好习惯,不管这个项目多少人参与,push之前先pull一下,看看有没有merge的代码,有merge解决merge,没有的话直接下面的命令

#git pull origin master
#git add .
#git commit -m 'init'
#git push origin master

OK,下面我们去看下代码是不是被添加上来了~

看到这个界面,我就放心了,因为我之前在gitos上搞过事,就用的之前的账户提交的代码,如果你有很多员工需要提交代码,那么你可以在设置里面添加他们的账号进来,给他们读写代码的权限。总之,码云还是很给力的。开心的撸代码吧,以后到哪都可以撸代码啦,好开心~~~



---------------------------


$ git add .
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/app.component.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/app.module.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart/chart.component.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart/chart.component.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in tsconfig.json.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart2/chart2.component.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart2/chart2.component.spec.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart2/chart2.component.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart3/chart3.component.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart3/chart3.component.spec.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart3/chart3.component.ts.
The file will have its original line endings in your working directory.


曾妙根@zengmiaogen MINGW64 /d/kuaipan/workspace_angular/dochart (master)
$ git commit -m "三大报表完成"
[master warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/app.component.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/app.module.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart/chart.component.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart/chart.component.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in tsconfig.json.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart/chart.component.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart2/chart2.component.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart3/chart3.component.ts.
The file will have its original line endings in your working directory.
ba26cff] 三大报表完成
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/app.component.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/app.module.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart/chart.component.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart/chart.component.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart2/chart2.component.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart2/chart2.component.spec.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart2/chart2.component.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart3/chart3.component.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart3/chart3.component.spec.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/app/chart3/chart3.component.ts.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in tsconfig.json.
The file will have its original line endings in your working directory.
 36 files changed, 1109 insertions(+), 773 deletions(-)
 create mode 100644 src/app/chart2/chart2.component.css
 create mode 100644 src/app/chart2/chart2.component.html
 create mode 100644 src/app/chart2/chart2.component.spec.ts
 create mode 100644 src/app/chart2/chart2.component.ts
 create mode 100644 src/app/chart3/chart3.component.css
 create mode 100644 src/app/chart3/chart3.component.html
 create mode 100644 src/app/chart3/chart3.component.spec.ts
 create mode 100644 src/app/chart3/chart3.component.ts
 delete mode 100644 src/app/charts/column.ts
 create mode 100644 src/app/charts/cslcs_pie.ts
 create mode 100644 src/app/charts/csyhs_pie.ts
 delete mode 100644 src/app/charts/gauge.ts
 delete mode 100644 src/app/charts/line.ts
 delete mode 100644 src/app/charts/pie.ts
 create mode 100644 src/app/charts/xllcs_pie.ts
 create mode 100644 src/app/charts2/line_column.ts
 create mode 100644 src/app/charts3/line_line.ts


曾妙根@zengmiaogen MINGW64 /d/kuaipan/workspace_angular/dochart (master)
$ git push origin master
Counting objects: 42, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (39/39), done.
Writing objects: 100% (42/42), 9.71 KiB | 0 bytes/s, done.
Total 42 (delta 30), reused 0 (delta 0)
To git@git.oschina.net:zengmg/dochart2.git
   2479f60..ba26cff  master -> master


曾妙根@zengmiaogen MINGW64 /d/kuaipan/workspace_angular/dochart (master)


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/538446.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

visual studio过期登录不了账户_具有最高管理权限账户,Windows 7设置Administrator密码永不过期...

今天介绍操作系统具有最高管理权限的账户&#xff0c;Windows 7如何设置Administrator账户密码永不过期。小伙伴们可能不知道&#xff0c;和Windows Vista操作系统一样&#xff0c;在Windows 7操作系统中是不能预先使用Administrator这个具有最高管理权限的账户的。同时也可能不…

cad隐藏图层命令快捷键_cad快捷键f是什么命令?cad中f快捷键都有哪些?

1. F1 该功能键打开AutoCAD帮助窗口。如果用户遇到此软件中的任何功能问题,它可以使用户在线获得帮助。如果用户离线工作,而不是按此键,则该软件的所有功能都将以PDF格式打开。 2. F2 该键将打开一个弹出屏幕,在底部显示命令行。该命令对于在屏幕底部看不到命令窗口的用户很…

java 高级编程进阶_JAVA高级编程之hibernate进阶学习

二级缓存hibernate的session缓存在事务级别进行持久化数据的缓存操作。 当然&#xff0c;也有可能分别为每个类(或集合)&#xff0c;配置集群、或 JVM 级别(SessionFactory 级别)的缓存。你甚至可以为之插入一个集群的缓存。注意&#xff0c;缓存永远不知道其他应用程序对持久化…

SpringMvc+Tomcat+Angular4 部署运行

这次的团队开发是&#xff0c;前端开发人员和后台开发人员完全分开开发的。 前端开发采用了Angular4&#xff0c;webstorm 后端开发采用了&#xff1a;springspringmvcmybatis&#xff0c;eclipse --------------------------------------- 最后要整合了。 1、angular项目编…

IPv4地址分类及特征

IPv4地址分类及特征 IP地址后斜杠和数字代表的意思 其中有这样一个IP地址的格式&#xff1a;IP/数字&#xff0c;例如&#xff1a;111.222.111.222/24这种格式平时在内网中用的不多&#xff0c;所以一下子看不懂&#xff0c;最后查了资料才知斜杠后的数字代表的是掩码的位数 “…

查看Scala编译的.class文件

Scala是基于JDK运行的&#xff0c;必然会生成Java的字节码文件.class文件。 如何查看&#xff1f; 编码IDE&#xff1a;IntelliJ IDEA 2017.2 x64 查看class文件工具&#xff1a;jd-gui scala代码如下&#xff1a; person.scala package cn.zengmg.day26class Person {val …

【原创】利用腾讯和百度的AI接口识别验证码

众所周知&#xff0c;验证码在大部分的实际运用中是绕不开的问题&#xff0c;包括验证&#xff0c;爬虫&#xff0c;测试等等&#xff0c;然后解决验证码的方法也有不少&#xff0c;但大多数都会运用OCR。&#xff08;这里说的验证码&#xff0c;是字符类型的验证码&#xff09…

java时间日期工具类_java工具类--日期相关;

日期相关Date类1.通常使用的是java.util包2.导包 拿来使用 构建对象3.通常使用无参数的构造方法 或者带long构造方法4.Date类中常用的方法before(); after();setTime() getTime()compareTo(); -1 1 0;5.可以处理一个Date类型的格式DateFormat类1.包java.text 需要导包使用2.此类…

/* compiled code */ ?

原因&#xff1a;这是所用的ide自带了反编译工具&#xff0c;反编译的。不是具体的源码 具体的源码需要手动关联源码包

重新学习Ubuntu -- 截图软件的选择和安装

前面两篇完成了&#xff1a;系统的安装和系统安装后的优化。 截图软件 shutterflameshot 这个根据自己原来的学习经验和网上的相关资料来完成截图软件的安装。参照文章&#xff1a; shutter :Ubuntu 18.04/LinuxMint 19中启用Shutter编辑功能 flameshot:Flameshot&#xff1a;你…

Scala-Actor并行wordcount

scala-2.10.6 文件&#xff1a; "d://word.txt", "d://word.log" 文件内容&#xff1a; 代码&#xff1a; package cn.zengmg.day26.actorimport scala.actors.{Actor, Future} import scala.collection.mutable.ListBuffer import scala.io.Sourcecase c…

小程序测试用例模板_微信小程序样式:高质量小程序样式模板大全

新手想要制作出美观的小程序&#xff0c;你需要多参考一些好看的微信小程序样式。今天就带大家分析几个高质量小程序的样式&#xff0c;看看别是怎么把小程序做得美观又吸引人的&#xff1a;1.电商小程序样式电商小程序首页一般是按照“图片banner - 快捷按钮 - 商品及分类”的…

Sql Server 2016数据库生成带数据的脚本

步骤&#xff1a;右键点击对应数据库->任务->生成脚本 在弹出的会话框中选择需要的对象&#xff0c;点击下一步&#xff0c;在设置和编写脚本选项中&#xff0c;点开高级按钮&#xff08;如图&#xff09;选择架构和数据点击确定就可以了。 提醒&#xff1a;如果你在数据…

深入理解Scala的隐式转换系统

原文链接&#xff1a;http://www.cnblogs.com/MOBIN/p/5351900.html----------------------------------------------摘要&#xff1a;通过隐式转换&#xff0c;程序员可以在编写Scala程序时故意漏掉一些信息&#xff0c;让编译器去尝试在编译期间自动推导出这些信息来&#xf…

Java连接MySQL

2019独角兽企业重金招聘Python工程师标准>>> <1> 在navicat中创建一个MySQL连接&#xff0c;填写连接名和密码&#xff08;密码为你配置MySQL设置的密码&#xff09; <2> 在该连接中新建一个数据库&#xff0c;填写数据库名。字符集选择&#xff08;gb-…

ssm实训报告心得_Java开发学习心得(一):SSM环境搭建

Java开发学习心得&#xff08;一&#xff09;&#xff1a;SSM环境搭建有一点.NET的开发基础&#xff0c;在学校学过基础语法&#xff0c;对JAVA有点兴趣&#xff0c;就简单学习了一下&#xff0c;记录一下从哪些方面入手的&#xff0c;暂时不打算深入到原理方面&#xff0c;先简…

java虚引用作用_深入理解Java中的引用(二)——强软弱虚引用

深入理解Java中的引用(二)——强软弱虚引用在上一篇文章中介绍了Java的Reference类&#xff0c;本篇文章介绍他的四个子类&#xff1a;强引用、软引用、弱引用、虚引用。强引用(StrongReference)强引用是我们在代码中最普通的引用。示例代码如下&#xff1a;Object o new Obje…

ruby 爬虫爬取拉钩网职位信息,产生词云报告

思路&#xff1a;1.获取拉勾网搜索到职位的页数 2.调用接口获取职位id 3.根据职位id访问页面&#xff0c;匹配出关键字 url访问采用unirest&#xff0c;由于拉钩反爬虫&#xff0c;短时间内频繁访问会被限制访问&#xff0c;所以没有采用多线程&#xff0c;而且每个页面访问时间…

idle扩展插件_Python3.4学习笔记之 idle 清屏扩展插件用法分析

本文实例讲述了Python3.4 idle 清屏扩展插件用法。分享给大家供大家参考&#xff0c;具体如下&#xff1a;python idle 清屏问题的解决&#xff0c;使用python idle都会遇到一个常见而又懊恼的问题——要怎么清屏?在stackoverflow看到这样两种答案&#xff1a;1.在shell中输入…

内存堆和栈的区别

原文链接&#xff1a;http://www.cnblogs.com/lln7777/archive/2012/03/14/2396164.html -------------------------------------------------------------------------------- 在计算机领域&#xff0c;堆栈是一个不容忽视的概念&#xff0c;我们编写的C语言程序基本上都要用…