日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

Linux要学git吗,git学习一 基于linux ubuntu git安装与配置

發布時間:2025/3/12 linux 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linux要学git吗,git学习一 基于linux ubuntu git安装与配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.安裝git

># sudo apt-get build-dep git-core git-doc

這個會安裝git-core和git-doc依賴的庫。

接下來去官網下載git的源碼包。把下載的git包解壓。

在解壓的目錄下執行下列的命令來編譯git

>#make prefix=/usr/local all doc

然后需要安裝git

>#sudo make install install install-doc

這樣你的git就可以被該計算機上的所有用戶使用了。

你可以使用下面的命令來查看自己的git版本號。

>#git --version

2.配置git

由于git并不像svn那樣有中心倉庫,所以并不需要想中心倉庫提供用戶名和密碼等。但是我們還是需要告訴

要通過用戶名和email地址來給git傳遞一些信息。這些信息通常被設置為global。這里必須設置的兩個是user.name

和user.email。user.name是提交代碼時顯示的名稱,user.email可以被其他開發者用于聯系你使用。

>#git config --global user.name "your name"

>#git config --global user.email "youraddr@xxx.com"

然后我們可以通過下面的命令來查看是否修改成功了呢。

>#git config --global --list

我們應該會看到我們剛才配置的信息。

除此之外,還可以調整git的顯示顏色來區分不同的變化。

>#git config --global color.ui "auto"

3.查看git幫助

>#git help

命令可以查看git的命令

The most commonly used git commands are:

add??????? Add file contents to the index

bisect???? Find by binary search the change that introduced a bug

branch???? List, create, or delete branches

checkout?? Checkout a branch or paths to the working tree

clone????? Clone a repository into a new directory

commit???? Record changes to the repository

diff?????? Show changes between commits, commit and working tree, etc

fetch????? Download objects and refs from another repository

grep?????? Print lines matching a pattern

init?????? Create an empty git repository or reinitialize an existing one

log??????? Show commit logs

merge????? Join two or more development histories together

mv???????? Move or rename a file, a directory, or a symlink

pull?????? Fetch from and merge with another repository or a local branch

push?????? Update remote refs along with associated objects

rebase???? Forward-port local commits to the updated upstream head

reset????? Reset current HEAD to the specified state

rm???????? Remove files from the working tree and from the index

show?????? Show various types of objects

status???? Show the working tree status

tag??????? Create, list, delete or verify a tag object signed with GPG

如果想查看git的具體命令使用可以通過下面命令做到,例如查看clone命令。

>#git help clone

到這我們已經配置好我們的git了,接下來就可以創建我們的工程了。明天接著寫喲。

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的Linux要学git吗,git学习一 基于linux ubuntu git安装与配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。