Git提交到github上

2022-09-14 08:45:10 字數 1792 閱讀 6738

1、本地建立乙個目錄redis

[guosong@etch171 mars171 redis]# pwd

/data1/guosong/code/redis

[guosong@etch171 mars171 redis]# ll

total 12

drwxr-xr-x 2 guosong guosong 4096 oct 24 01:09 list_20141023

drwxr-xr-x 2 guosong guosong 4096 oct 23 00:36 sds_20141021

drwxr-xr-x 2 guosong guosong 4096 oct 23 23:13 sds_20141022

2、生成git初始化倉庫git init

產生.git目錄

[guosong@etch171 mars171 .git]# more config 

[core]

repositoryformatversion = 0

filemode = true

bare = false

logallrefupdates = true

3、配置使用者名稱和郵箱

git config --global user.name "sguo421"

git config --global user.email "[email protected]"

.git/config檔案發生變化

[guosong@etch171 mars171 redis]# more .git/config 

[core]

repositoryformatversion = 0

filemode = true

bare = false

logallrefupdates = true

[remote "github"]

url =

fetch = +refs/heads/*:refs/remotes/github/*

4、github配置ssh-keys避免提交的時候輸入使用者名稱和密碼

5、建立乙個repository

否則提示出錯

error: repository not found.

fatal: the remote end hung up unexpectedly

6、提交**

git add list_20141023/

git add sds_2014102*

git commit -m "learning redis source code step by step"

#使用ssh遠端提交模式

#git remote add origin [email protected]:youusername/test.git

git remote add origin [email protected]:sguo421/redis.git

git push -u origin master

[參考資料]

git本地提交到github遠端

將git的本地倉庫上傳到github遠端 1 首先要註冊乙個github賬號。登入 github 官網進行註冊,會發乙個認證碼到你的註冊郵箱中,獲取認證碼填寫後就可以註冊成功了。2 註冊完成後,使用 new repository,新建乙個倉庫 這裡建立的倉庫名稱是gittest,然後在 clone ...

git使用與提交到github的操作

先在github上面建立乙個新倉庫 只要乙個mit的license即可 然後找到這個位址複製 在vscode裡面開啟專案,在專案外執行git clone 複製的位址建立與專案同級的資料夾,把專案檔案除了.git資料夾和node mouduls資料夾外其他檔案全部複製到新建立的資料夾裡面,開啟該終端,...

將新專案提交到git上

在提交之前需要理解幾個基本的知識 git是乙個管理倉庫,你要是想要放到git的倉庫中,首先你本地也要有乙個本地倉庫,而倉庫中有乙個個分支,這乙個個分支就像是乙個個貨架,當然,當你建立好倉庫時 不管是本地,還是遠端 倉庫中都有乙個分支,叫 master 分支,這個分支是所有操作的主分支,當你 進行修改...