右鍵–>git bash here:先輸入ssh-keygen –t rsa –c "郵箱位址",注意ssh-keygen之間是沒有空格的,其他的之間是有空格的,郵箱位址是咱們在註冊github的時候用的郵箱。
生成的金鑰在這裡:c:\users\administrator\.ssh
右上頭像箭頭->settings->左側ssh and gpg keys,new ssh key,貼上,add gpg key
administrator@fezlin8tdst7kof mingw64 /githere
$ ssh -t git@github.com
the authenticity of host 'github.com (13.250.177.223)' can't be established.
rsa key fingerprint is sha256:nthbg6kxupjwgl7e1igocspromtxdcarlvikw6e5sy8.
are you sure you want to continue connecting (yes/no)? yes
這裡回覆乙個yes,而!不!是!習!慣!性!回!車!!
warning: permanently added 'github.com,13.250.177.223' (rsa) to the list of known hosts.
hi xiaobai0419! you've successfully authenticated, but github does not provide shell access.
這時是在c盤.ssh目錄下多生成了乙個known_host檔案,再次嘗試命令,成功:
administrator@fezlin8tdst7kof mingw64 /githere
$ ssh -t git@github.com
hi xiaobai0419! you've successfully authenticated, but github does not provide shell access.
idea進行github賬號登入時,使用https(使用者名稱密碼)或ssh協議(金鑰)如才能順利登入,http是無法成功的。
$ git init
$ git add .
$ git commit -m 'dubbo first commit'
$ git remote add origin /xiaobai0419/minexiaobai0419.git
$ git push -u origin master
username for '': xiaobai0419
需要輸入github註冊的使用者名稱、密碼後確認
$ git pull --rebase origin master
fork分支和主分支同步,並提交到fork分支(自己的遠端倉庫,必須是先在**上fork乙份原作者分支到自己的遠端倉庫,然後git clone自己fork的遠端倉庫!):
gitlab的合併分支申請:
安裝時按步驟先到其**建立乙個自己賬號,完成安裝。安裝後可以關聯多個遠端倉庫,包括自己建立賬號的倉庫,或者軟體支援的github、gitlab等上面自己的賬號。
將開源專案先fork到自己的遠端倉庫,然後使用該工具從自己的遠端倉庫位址clone到本地的乙個倉庫(建立好的資料夾),按文中建立各種分支,停留在某個分支上,使用ide修改本地倉庫原始碼,或手動增減、修改檔案,停留的分支自動感應變化,再按文中提示進行提交、編輯衝突、合併分支、推送到遠端倉庫,其中推送到遠端倉庫需要提供你自己遠端倉庫的使用者名稱、密碼,確認後成功推送。
a.配置好git,github個人賬號、密碼
b.選中專案,使用vcs->import into version control->share project on github,這樣只能在遠端建立乙個同名的空倉庫:
c.這時專案右鍵出現git,選擇add,commit你想提交的部分
修改成正確的github遠端倉庫位址之後,使用push即可遠端推送**成功。
e.要使用idea從遠端github庫引進乙個專案,需要使用vcs->git->clone,新增遠端庫git位址,修改後可按上述方法直接提交,推送到遠端庫。
參照注意點選compare across forks時,base fork選填自己fork的專案,head fork選填原作者主分支專案,這樣才能操作成功!!
Git有關建立與提交專案的命令
git 的工作就是建立和儲存你專案的快照及與之後的快照進行對比。本章將對有關建立與提交你的專案快照的命令作介紹。git 常用的是以下 6 個命令 git clone git push git add git commit git checkout git pull,後面我們會詳細介紹。說明 乙個簡單...
專案提交git
已經有了乙個正在開發的專案,現在我們要把他分享到git osc上面去。1.第一步,先在git osc上建立倉庫,拿到git osc倉庫的http連線 2.如果本地專案是非git專案,那先把它變成git專案 在intellij中 vcs import into version control crea...
Git學習(一) 倉庫建立與提交
1 鏈結倉庫 git remote add origin2 將內容從工作目錄新增到暫存區 git add 1.pdf 加上自己的檔案名字即可 3 將所有通過 git add 暫存的檔案內容在資料庫中建立乙個持久的快照,然後將當前分支上的分支指標移到其之上。git commit m 1.pdf 4 推...