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.pswp.cn/news/538446.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/538446.shtml
英文地址,請注明出處:http://en.pswp.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.此類…