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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

git的一些基本命令总结

發布時間:2023/12/14 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 git的一些基本命令总结 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

最近剛剛開始使用Git,對于所有的一些命令以及環境都不是很熟,這里個人總結一下。

1.git的安裝和初次使用配置

? ?ubuntu安裝git下直接命令

sudo apt-get install git

? ?git一般和repo一起使用,所以需要配置repo

#you can rename the dir according to your habits mkdir [devDir] && cd [devDir]#-------------------------------------------------------- #references: https://source.android.com/source/downloading.html #install repo #you can change the dir but you must ensure the dir is included in your PATH mkdir ~/bin PATH=~/bin:$PATH#Download Repo and ensure it is executable #make sure the dir the same as before curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo chmod a+x ~/bin/repo
? ?初次使用git需要配置user.name以及user.email

#First time must set user.name and user.email git config user.name "[username]" git config user.email [username@example.com]
? ?初始化repo,也就是通過ssh與相應的git服務其建立鏈接

#initialize repo repo init -u ssh://[url].git

? ?最后一部同步代碼

#until now you can Sync codes from the git repo sync
至此相應的開發代碼已經同步到對應的目錄[devDir]下。

注:以上命令中,帶有"[ ]"的都是需要根據實際情況替換的。


2.開發過程中使用git的一般流程

? ?同步代碼,前面已經說過;

? ?創建分支

git branch [branch] --track origin/[branch]

? ?

? 關聯分支

git branch [branch] --set-upstream origin/[branch]


? 查看分支狀態

git branch

? 切換到[branch]分支

git checkout master

? 將修改完畢的code加入到暫存區 git add .
? 查看當前暫存區狀態

git status
? 將暫存區的修改提交到本地庫

git commit -s -m "comment"


? 上傳項目代碼到服務器git系統

repo upload .

慢慢熟練,不斷完善中~~~~~~~加油!!!!

總結

以上是生活随笔為你收集整理的git的一些基本命令总结的全部內容,希望文章能夠幫你解決所遇到的問題。

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