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,一经查实,立即删除!

相关文章

你不知道的js中关于this绑定机制的解析[看完还不懂算我输]

前言 最近正在看《你不知道的JavaScript》&#xff0c;里面关于this绑定机制的部分讲的特别好&#xff0c;很清晰&#xff0c;这部分对我们js的使用也是相当关键的&#xff0c;并且这也是一个面试的高频考点&#xff0c;所以整理一篇文章分享一下这部分的内容&#xff0c;相信看…

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

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

Tomcat安装与环境变量的配置-Linux+windows

原文链接&#xff1a;http://jingyan.baidu.com/article/8065f87fcc0f182330249841.html ------------------------------------------------------------ 1&#xff0c;新建变量名&#xff1a;JAVA_HOME&#xff0c;变量值&#xff1a;C:\Program Files\Java\jdk1.7.0 2&…

python如何读取配置文件获取url以及hhead_读取INI配置文件内容(头文件head)

/************************************************************FileName: getini.h // 文件名称Author: yuanfen127 // 作者Date: 2005-03-31 // 日期Description: // 描述本文件的内容,功能,内部各部分之间的关系// 以及文本文件与…

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

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

angular2或4部署到tomcat中,让他跑起来

原文地址&#xff1a;http://blog.csdn.net/rotating_windmill/article/details/76768793 ------------------------------------------------------------------------- 首先使用构建命令(npm run build或ng build)打包&#xff0c;打包完成后项目中会出现一个dist的目录&…

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

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

SpringMvc+Tomcat+Angular4 部署运行

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

python爬虫本科容易找工作吗_python爬虫基础学完了,我真的能找到一份工作吗?...

1.能不能找到工作我觉得取决于你技术掌握的程度。2.无论在什么领域&#xff0c;只要你技术到家&#xff0c;都不用愁找不到工作。3.多数人问他们转行能不能找到工作&#xff0c;是想知道这个岗位需要的人多不多&#xff0c;在爬虫这个领域&#xff0c;从事这方面的人应该也不少…

jqgrid demo java_java – jqgrid如何显示服务器端消息

我使用jqGrid以表格格式显示数据,使用JSP和servlet.编辑我想在执行插入,更新,删除等操作时显示来自服务器的错误. (数据类型&#xff1a;“xml”)jqGrid的jQuery("#list10_d").jqGrid({height:250,width:600,url:Assignment?actionAssign,datatype: "xml"…

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 …

python传文件给堡垒机上远程的另一个机器_如何用hive调度堡垒机上的python脚本...

工作中&#xff0c;如果我们本地要操作的数据量大&#xff0c;那么主机是跑不起来python脚本的&#xff0c;这个时候&#xff0c;就要用到服务器(也叫堡垒机)了。那么如何用HIVE调用堡垒机上的python脚本呢&#xff1f;今天小白就总结一下步骤和一些注意事项~1.首先将Python脚本…

SecureCRT如何导出导入配置文件

以SecureCRT7.2.5为例 Options-----Global Options -----General -----Configuration Paths 备份&#xff1a; 进入该文件夹&#xff0c;复制里面的内容到要备份的地方 还原&#xff1a; 将上面的复制的文件&#xff0c;拷贝到 Configuration Paths 下

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

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

在java中5 % 3_Java基础5

Java多线程:进程:进行中的程序线程:就是进程中一个负责程序执行的控制单元(执行单元)一个进程中可以多执行路径&#xff0c;称之为多线程一个进程至少一个线程开启多个线程是为了同时运行多部分代码每个线程都有自己运行的内容&#xff0c;这个内容成为线程要执行的任务多线程的…

scala中:: , +:, :+, :::, +++的区别

原文链接&#xff1a;https://segmentfault.com/a/1190000005083578 ------------------------------------------------------------- 4种操作符的区别和联系 :: 该方法被称为cons&#xff0c;意为构造&#xff0c;向队列的头部追加数据&#xff0c;创造新的列表。用法为 x::…

python包管理机制_Go 1.5之前的多种包管理机制简介(

在 Go 语言中&#xff0c;我们可以使用go get命令安装远程仓库中托管的代码&#xff0c;不同于 Ruby Gem、pypi 等集中式的包管理机制&#xff0c; Go 语言的包管理系统是去中心化的。简单来讲&#xff0c;go get命令支持任何一个位置托管的 Git 或 Mercurial 的仓库&#xff0…

nc命令简介

nc介绍 ncat/nc 既是一个端口扫描工具&#xff0c;也是一款安全工具&#xff0c;还能是一款监测工具&#xff0c;甚至可以做为一个简单的 TCP 代理。 在大多数 Debian 发行版中&#xff0c;nc 是默认可用的&#xff0c;它会在安装系统的过程中自动被安装。 但是在 CentOS 7 / R…

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.此类…