您好,登錄后才能下訂單哦!
本篇文章給大家分享的是有關(guān)git使用的小竅門是什么,小編覺得挺實用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
git(讀音為/g?t/。)是一個開源的分布式版本控制系統(tǒng)可以有效、高速地處理從很小到非常大的bai項目版本管理。Git 是 Linus Torvalds 為了幫助管理 Linux 內(nèi)核開發(fā)而開發(fā)的一個開放源碼的版本控制軟件。
這里介紹設(shè)置git使用的兩個小竅門
第一:修改使git擁有unix的優(yōu)良特性(自動完成)
在安裝成功git后,會遺留安裝目錄,這個操作就是針對那個目錄的操作。
[root@localhost ~]# cp git-1.7.7.4/contrib/completion/git-completion.bash ~./.git-completion.bash //把這個文件復(fù)制成為用戶家目錄下的同名的隱藏文件[root@localhost ~]# vi .bashrc //加上下邊的那句話
source ~/.git-completion.bash
[root@localhost ~]# source .bashrc
最后進(jìn)入git的工作區(qū)域做測試
[root@localhost ~]# cd /git/status/[root@localhost status]# git sta //兩次tab 就出現(xiàn)了以下的情況,巨開心吧
stage stash status
出現(xiàn)這個提示對于我們記憶大量的命令無疑是一種福音。
第二:設(shè)置git命令的別名
以git commit這個命令為實例
在正常的情況下以下是一個完整的過程
[root@localhost status]# vi st1[root@localhost status]# git add st1[root@localhost status]# git commit -m “2nd commit”[master 41934ca] 2nd commit
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 st1
在設(shè)置使用別名后再對比下看看
[root@localhost status]# vi st2[root@localhost status]# git add st2[root@localhost status]# git config –global alias.ci commit[root@localhost status]# git ci -m “3rd commit”[master 6a5cb99] 3rd commit
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 st2
以上就是git使用的小竅門是什么,小編相信有部分知識點(diǎn)可能是我們?nèi)粘9ぷ鲿姷交蛴玫降?。希望你能通過這篇文章學(xué)到更多知識。更多詳情敬請關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。