github使用學習

2021-06-18 07:53:11 字數 1268 閱讀 6011

提交/獲取文件過程:

1.建立乙個資料夾

2.git init 初始化

生成了隱藏的.git資料夾

3.git add [$path_of_files]

新增要管理的檔案,(檔案需要在當前資料夾下,否則報錯)

git add .——新增當前目錄下所有內容

4.git commit -am "my commit"

引數「-am」意義可通過「git commit --help」命令檢視

5.git remote add origin [email protected]:[$your_name]/[$your_repo.git]

e.g.git remote add origin [email protected]:lix219/test.git

做完以上設定後,再使用git push會自動提交文件到該位址

6.git push origin master

提交資料到遠端master分支

7.git pull origin master

從遠端獲取最新版本並合併到本地

要直接使用git pull,需設定:git branch --set-upstream master origin/master(這句直接輸入即可)

複製乙個git專案

1.進入工作資料夾

3.git pull 更新文件

分支

概念:暫不知

git branch:檢視當前分支

git branch [$branch_name]:建立分支

git checkout [$branch_name]:轉換分支

git branch -d [$branch_name]:刪除分支

變更者資訊

git config --global user.name "$your_name"

git config --global user.email "$your_email"

這樣提交的文件會有變更者的資訊,便於管理

github 初步學習使用github

1 1 github簡明教程 1 2 對本地倉庫進行更新 1 3 超級全的github指令 2 常用命令 git add filename 新增檔案到本地index快取區 git add 新增所有檔案到index區 git commit m 將上述檔案新增到head區 git push origin...

學習使用GitHub

git add 新增 該命令是將一些修改寫進本地記錄裡面,我們把本地記錄叫做索引庫 head緩衝區 git add a stages all include modified,delete and new git add stages new and modified git add u stage...

學習使用github

首先註冊帳號 登入 建立專案 建立好之後看到有歌http和ssh選擇,我選擇ssh。位址是git github.com firadio filecount.git 然後在shell裡輸入git clone git github.com firadio filecount.git 之後就可以把檔案gi...