生活随笔
收集整理的這篇文章主要介紹了
Github使用1-入门
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
Gighub官網(wǎng):https://github.com/
Github的入門使用流程:
1、注冊github帳號。
2、登陸帳號后創(chuàng)建一個repository。如命名為:GitTest
點擊進入后得到其地址:
https://github.com/Thinkerfans/GitTest
3、安裝Git 工具。(Linux系統(tǒng)上)
4、將gitHub上帳號綁定到git工具上。若不綁定,當(dāng)你執(zhí)行g(shù)it commit ?是報如下錯誤。
[java] view plaincopy
***?Please?tell?me?who?you?are.????Run??????git?config?--global?user.email?"you@example.com"????git?config?--global?user.name?"Your?Name"????to?set?your?account's?default?identity.??Omit?--global?to?set?the?identity?only?in?this?repository.????fans@yuan:src$?git?config??--global?user.email?"2656079093@qq.com"??fans@yuan:src$?git?config?--global?user.name?"thinker"??
此郵件和用戶名就是你gitHub上Profile里面的用戶名和郵箱號。
5、在本地電腦上創(chuàng)建一個文件夾,如:gitspace
6、轉(zhuǎn)到此目錄下,執(zhí)行g(shù)it init
[java] view plaincopy
fans@yuan:gitspace$?git?init??Initialized?empty?Git?repository?in?/home/fans/gitspace/.git/??
7、將github上創(chuàng)建的倉庫GitTest拷貝到gitspaces目錄下
[java] view plaincopy
fans@yuan:gitspace$?git?clone?https:??Cloning?into?'GitTest'...??remote:?Counting?objects:?3,?done.??remote:?Total?3?(delta?0),?reused?0?(delta?0)??Unpacking?objects:?100%?(3/3),?done.??fans@yuan:gitspace$?ls??GitTest??
8、本地編輯后同步到gitHub上的步驟:
[java] view plaincopy
fans@yuan:GitTest$?vim?test.c??fans@yuan:GitTest$???fans@yuan:GitTest$???fans@yuan:GitTest$?ls??README.md??test.c??fans@yuan:GitTest$?git?add?test.c??fans@yuan:GitTest$?git?commit?-m?"add?test.c?file"??[master?107f2db]?add?test.c?file???1?file?changed,?4?insertions(+)???create?mode?100644?test.c??fans@yuan:GitTest$?git?pu??pull???push?????fans@yuan:GitTest$?git?push???Username?for?'https://github.com':?Thinkerfans??Password?for?'https://Thinkerfans@github.com':???To?https:?????1b0439b..107f2db??master?->?master??
查看gitHub上是否已經(jīng)有test.c這個文件。
來源:http://blog.csdn.net/sunnyfans/article/details/17199507
總結(jié)
以上是生活随笔為你收集整理的Github使用1-入门的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。