git and github


目錄:
1送浊、git 梦谜、github 介紹
2、git本地操作()
3袭景、git遠(yuǎn)程操作

1.git 唁桩、github、repository耸棒、

git is one of the most popular SCM(Source Control Management) tools. It can be used for large and small, and is agnostic to the types of content in the projects. We use git to manage our work in daily life.

Git is distributed, different from some other SCM tools, that means there is no central repository.For this reason, git has become very popular for the development of what is known as Free and Open Source Software,or FOSS.

And,Repository, or repo for short, is a place where your code and version history is stored.

You known that most SCM tool require a Client/Server architecture, where a centralized server hostes the main repository, and developers work with clients that commit code to the main repository. However, git,considered aa distributed version control system, is different. There is no main central repository, and developers on a project work with local repositories, pushing commits around directly to each other. yep, to be truth, most developers using git will not push commits directly to each other. Instead, they rely on central repository to act as the main repo, and that main repo is typically hosted on Github.com.

So, a Local repository refer to a repository located on the pc you are using now . A Remote repository, on the other hand, refers to a repository that is located on another computer or server. Repository created on Github.com are considered remote because they are located on Github's server.

And ,github.com took the git program and connected the people and code over the web, creating an eco-system and user interface for software projects. Another words, Github is the best place to share our code with friends, co-workers, classmates, and complete strangers.


有關(guān)git 的初始化內(nèi)容就不展開荒澡,不清楚的自行搜索解決。

ofcoure, you guys can use git GUI to initial git on your computer.

2与殃、git 本地操作

next, i will decribe how to do those work step by step. Just relax and follow me .
第一步:創(chuàng)建project.
1单山、創(chuàng)建一個project目錄

$ mkdir git_basics  
$ cd git_basics  
git_basics/ $ echo '# README #' > README.md  
git_basics/ $ echo '# LICENSE #' > LICENSE.md    

2、git init 為你的project初始化git

git_basics/ $ git init   

3幅疼、修改the config File

git_basics/ $ git config --global user.name "peterswj"    
git_basics/ $ git config --global user.email   peterswj@163.com  

創(chuàng)建.gitignore

git_basics/ $ mkdir db  
git_basics/ $ touch db/development.sqlite3  
git_basics/ $ touch .gitignore  

打開.gitignore米奸,向里面添加如下內(nèi)容contents

 # Ignore all SQLite databases
  db/*.sqlite3

something on the config files, you can refer to the link below:
https://launchschool.com/books/git/read/creating_repositories#createanexampleproject

第二步:創(chuàng)建track
1、查詢git 狀態(tài)   git status
2爽篷、創(chuàng)建 commit git add 悴晰, git commit
3、查詢提交日志 git log

第三步:分支結(jié)構(gòu)(Branching)
(后續(xù)更新)

3逐工、git 遠(yuǎn)程操作

(后續(xù)更新)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末铡溪,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子泪喊,更是在濱河造成了極大的恐慌棕硫,老刑警劉巖,帶你破解...
    沈念sama閱讀 216,372評論 6 498
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件窘俺,死亡現(xiàn)場離奇詭異饲帅,居然都是意外死亡复凳,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,368評論 3 392
  • 文/潘曉璐 我一進店門灶泵,熙熙樓的掌柜王于貴愁眉苦臉地迎上來育八,“玉大人,你說我怎么就攤上這事赦邻∷杵澹” “怎么了?”我有些...
    開封第一講書人閱讀 162,415評論 0 353
  • 文/不壞的土叔 我叫張陵惶洲,是天一觀的道長按声。 經(jīng)常有香客問我,道長恬吕,這世上最難降的妖魔是什么签则? 我笑而不...
    開封第一講書人閱讀 58,157評論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮铐料,結(jié)果婚禮上渐裂,老公的妹妹穿的比我還像新娘。我一直安慰自己钠惩,他們只是感情好柒凉,可當(dāng)我...
    茶點故事閱讀 67,171評論 6 388
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著篓跛,像睡著了一般膝捞。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上愧沟,一...
    開封第一講書人閱讀 51,125評論 1 297
  • 那天蔬咬,我揣著相機與錄音,去河邊找鬼央渣。 笑死计盒,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的芽丹。 我是一名探鬼主播,決...
    沈念sama閱讀 40,028評論 3 417
  • 文/蒼蘭香墨 我猛地睜開眼卜朗,長吁一口氣:“原來是場噩夢啊……” “哼拔第!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起场钉,我...
    開封第一講書人閱讀 38,887評論 0 274
  • 序言:老撾萬榮一對情侶失蹤蚊俺,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后逛万,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體泳猬,經(jīng)...
    沈念sama閱讀 45,310評論 1 310
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,533評論 2 332
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了得封。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片埋心。...
    茶點故事閱讀 39,690評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖忙上,靈堂內(nèi)的尸體忽然破棺而出拷呆,到底是詐尸還是另有隱情,我是刑警寧澤疫粥,帶...
    沈念sama閱讀 35,411評論 5 343
  • 正文 年R本政府宣布茬斧,位于F島的核電站,受9級特大地震影響梗逮,放射性物質(zhì)發(fā)生泄漏项秉。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,004評論 3 325
  • 文/蒙蒙 一慷彤、第九天 我趴在偏房一處隱蔽的房頂上張望娄蔼。 院中可真熱鬧,春花似錦瞬欧、人聲如沸贷屎。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,659評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽唉侄。三九已至,卻和暖如春野建,著一層夾襖步出監(jiān)牢的瞬間属划,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,812評論 1 268
  • 我被黑心中介騙來泰國打工候生, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留同眯,地道東北人。 一個月前我還...
    沈念sama閱讀 47,693評論 2 368
  • 正文 我出身青樓唯鸭,卻偏偏與公主長得像须蜗,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子目溉,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,577評論 2 353

推薦閱讀更多精彩內(nèi)容