Git 基本操作 實用

2021-10-05 04:25:09 字數 878 閱讀 4901

git  clone  

把工程clone下來之後,進入工程所在的資料夾

git  rm  file_name       

git commit -m "delete"

git push -u origin master

git  pull

本地的修改工作。。。

git add .

git commit  -m  ''修改說明''

git push -u origin master

git branch  test_gp     建立乙個test_gp的分支

git checkout test_gp   切換到teat_gp分支

git add .    在本地倉庫新增需要上傳的**

git commit -m "first commit"  提交說明

git push origin test_gp  將本地倉庫的**提交到github上

接下來輸入使用者名稱和密碼就成功了!!! 

如何拉取github上的分支:

首先把github上的工程clone到本地

然後執行下面命令:

git checkout -b 分支名 origin/分支名

針對git中有些大檔案需要頻繁提交,會導致git工程急劇變大和臃腫。可以使用lfs,git工程中儲存的將是指標檔案,而實際的檔案將被儲存在lfs中。

git lfs track "*.pth"

git add .

git commit -m "add *.pth"

git push -u origin master

參考:推薦的學習教程

git命令實用操作

git提交流程 1 git status 檢視狀態 有多少檔案進行了修改 2 git diff 檢視具體的修改 3 git add 把所有的修改提交到暫存區 4 git commit m 修改說明 5 git pull origin develop 分支,根據需要 從git上獲取遠端分支的更新,可能...

Git實用操作命令

cat file檢視檔案內容 git config global user.name your name git config global user.email email example.com git init把目錄s變成git可以管理的倉庫 git add.檔名 由工作區新增到暫存區 git...

Git基本操作

1.初始化倉庫 git init 2.配置作者資訊 git config global user.email youremail corp.com git config global user.name yourname 3.新增檔案到暫存區 git add git add 新增所有檔案到暫存區 4...