Git相關(guān)使用命令有哪些

小編給大家分享一下Git相關(guān)使用命令有哪些,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

在德保等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場(chǎng)前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都網(wǎng)站建設(shè)、網(wǎng)站建設(shè) 網(wǎng)站設(shè)計(jì)制作定制網(wǎng)站制作,公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),成都品牌網(wǎng)站建設(shè),網(wǎng)絡(luò)營(yíng)銷推廣,外貿(mào)網(wǎng)站制作,德保網(wǎng)站建設(shè)費(fèi)用合理。

Git相關(guān)使用命令有哪些

全局設(shè)置

git config --global user.name "zyl"
git config --global user.email xxx@xxx.com
git config --list 檢查你的git設(shè)置
git clone xxxxxx.git

添加新的文件

vim demo.txt
git add demo.txt 添加新的文件
git commit -m 'this is first commit' 提交到本地倉(cāng)庫(kù),并且設(shè)置注釋
git push 將推送這一轉(zhuǎn)變?yōu)橹鞣种?
git rm xxx.txt 刪除文件
git commit -m 'xxxx'; 提交到倉(cāng)庫(kù)
git push
git pull 拉取文件
git log -all 日志
git branch 查看所有分支
git log --stat xxx 查看 某個(gè)支點(diǎn)的提交信息
find .git/objects -type f 查看所有分支

阿里云相關(guān)命令:

命令行指令

Git 全局設(shè)置

git config --global user.name "z1577121881"
git config --global user.email "1577121881@qq.com"

創(chuàng)建新版本庫(kù)

git clone git@code.aliyun.com:z1577121881/tantou.git
cd tantou
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

已存在的文件夾或 Git 倉(cāng)庫(kù)

cd existing_folder
git init
git remote add origin git@code.aliyun.com:z1577121881/tantou.git
git add .
git commit -am "你需要填寫的一些信息"
git push -u origin master

碼云相關(guān)命令

設(shè)置全局信息

git config --global user.name "你的名字"
git config --global user.email "你的Email"
clone 和push
git clone http://xxxx/xxxx.git

創(chuàng)建特征分支

git checkout -b $feature_name

提交代碼

git commit -am "this is commit "

推送到指定分支

git push origin $feature_name

為了方便,最好添加公鑰到git.

可以通過(guò)下面命令生成

ssh-keygen -t rsa -C "xxxxx@xxxxx.com"# Creates a new ssh key using the provided email
# Generating public/private rsa key pair...

查看public key

cat ~/.ssh/id_rsa.pub
# ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc....

添加后,在終端(Terminal)中輸入

ssh -T git@git.oschina.net

若返回Welcome to Git@OSC, yourname!

看完了這篇文章,相信你對(duì)“Git相關(guān)使用命令有哪些”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!

分享名稱:Git相關(guān)使用命令有哪些
文章路徑:http://bm7419.com/article46/jdehhg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制開(kāi)發(fā)、建站公司、營(yíng)銷型網(wǎng)站建設(shè)標(biāo)簽優(yōu)化、企業(yè)建站、域名注冊(cè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營(yíng)