1.在網頁版的github下新建倉庫
然後
git clone (你的倉庫名git@github.com:***/***.git
2.在git bash終端使用 cd 命令切換進clone的目錄
此時可以使用git status看下情況,當然,啥也木有
3.這裡,初始化一下倉庫on branch master
initial commit
nothing to
commit (create/copy files and use "git add"
to track)
git init
4.然後把資料夾中你要新增的東西,使用
git add ***
5.可以建乙個readme.md,markdown格式的檔案,使用touch命令
touch readme.md
6.將檔案加入暫存區,然後使用git commit,-m後的是提交資訊,是對本次提交的概述
不加-m的話,會彈出乙個vi編輯器介面,注意把要說的話在寫進去,去除#即可,否則不生效git commit -m "this is a demo,you can say whatever you'd like to say"
提交好了可以通過git log 看下日誌
7.push
到上一步,github上的倉庫還木有被更新,此時需用push命令
git push
done
坑: 如果clone到乙個空倉庫,開始不init的話,後面會提示你
這時候可能即使你執行這兩行了,也沒反應。*** please tell me who you are.
run git config --global user.email "you@example.com"
git config --global user.name "your name"
toset your account's default identity.
omit --global
toset the identity only in this repository.
fatal: empty ident name (for
<(null)>) not allowed
解決方法是到你這個資料夾的目錄,win的話開啟隱藏的.git資料夾,config這個檔案開啟,加入
就好了。。。[user]
name=yourname
email=youremail
Github 基本操作
github 基本操作 配置git 首先在本地建立ssh key ssh keygen t rsa c your email youremail.com 後面的your email youremail.com改為你的郵箱,之後會要求確認路徑和輸入密碼,我們這使用預設的一路回車就行。成功的話會在 下生...
github基本操作
一 使用者名稱和郵箱 1.檢視使用者名稱和郵箱 git config user.name git config user.email 2.修改使用者名稱和郵箱 git config global user.name username git config global user.email emai...
github基本操作
1 註冊github賬號 第一步肯定是先去github官網註冊個賬號 2 新建repository 新建repository,例如 python 專門儲存用python編寫的一些指令碼 會得到倉庫位址,git支援兩種協議 https 與 ssh,本文使用 https 方式 3 安裝git客戶端 因為...