ubuntu 下github使用(簡要過程)

2021-07-26 04:49:14 字數 1675 閱讀 9291

身為乙個碼農,掌握必要的**管理工具,是必不可少的。這裡簡單介紹一下github的簡單使用過程。

一、註冊github賬號。

請自行進入進行註冊。

二、安裝git及一些基本設定。

1.安裝git  

sudo apt-get install git
2.設定github賬號資訊

git config --global user.name "your name here"

git config --global user.email "your [email protected]"

這裡「your name here」輸入的是你註冊github的使用者名稱,這一步是設定你提交時,預設的使用者名稱。

類似的,「your [email protected]」是你註冊github賬號的郵箱,也可以用別的郵箱,不過用別的郵箱時,需要在github主頁上設定裡面把用的郵箱新增進去。

3.設定讓credential helper 幫助我們在一定時間內在記憶體中儲存我們的code,其中第二行為設定超時的時間

git config --global credential.helper cache

git config --global credential.helper 'cache --timeout=3600'

三、建立新的repository

四、針對乙個新建立的repository的操作(已有專案,跳過此小節,直接看第五節)

1.先建立乙個目錄,該目錄與你新建的repos有關 

mkdir ~/test_project
cd ~/test_project

git init //初始化乙個空的git repository

touch readme //readme 檔案用於描述該專案

2.提交剛剛加入的readme檔案

git add readme

git commit -m "first commit" //-m 用於指定本次提交的描述資訊

3.提交到repository

git remote add origin //username//test_project.git
之後會要求輸入使用者名稱和密碼,輸入即可

提交命令是:

git push -u origin master
五、已有專案

1. 先clone下來

git clone /username/test_project.git
2. 進入到test_project檔案中,進行檔案修改,刪除等操作

3.提交

git add .   // .代表新增所有檔案

git commit -m "對檔案操作的簡易描述"

git push -u origin master

Ubuntu下GitHub的使用

os ubuntu13.04 64bits git 1.8.1.2 執行如下命令安裝git sudo apt get install git git core git gui git doc git svn git cvs gitweb gitk git email git daemon run g...

ubuntu下使用git和github

沒有github賬戶的請自行申請 git config global user.name 使用者名稱或者使用者id git config global user.email 郵箱 ssh keygen c you email address com t rsa 公鑰預設位址為 ssh id rsa....

ubuntu下配置git和github

1 需求和環境 硬體 一台裝有ubuntu系統的pc或者虛擬機器 測試為ubuntu11.10 軟體 openssh server openssh client git core 2 安裝配置git伺服器 a 安裝ssh,因為git是基於ssh協議的,所以必須先裝ssh sudo apt get i...