git和github在linux的基本使用

2021-09-21 16:18:16 字數 805 閱讀 4365

git config --global user.name "woaigithub" 

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

//新建公鑰和私鑰 

ssh-keygen -c "[email protected]" -t rsa 

//顯示公鑰內容,拷貝到github的settings的public key中 

cat /home/andy/.ssh/id_rsa.pub 

//測試和github的聯通性 

ssh -v [email protected] 

//在github新建repository,名稱是rubyforum 

//在本地執行 

mkdir rubyforum 

cd rubyforum 

git init 

touch readme 

cat >

> readme 

ruby forum 

//[ctrl+d]退出 

git add readme 

git commit -m "first commit" 

git add remote origin  

git push origin master 

驗證ssh

指定key檔案

用於單機多ssh使用者認證。

ssh -v [email protected] -i /root/.ssh/id_rsa_gitcafe 

多個github帳號的ssh key切換

在Github和Git上如何Fork?

剛接觸git和github時,最困擾的一件事情就是嘗試解決下面的問題 在git和github上,我能做什麼?現在有這樣一種情形 有乙個叫做joe的程式猿寫了乙個遊戲程式,而你可能要去改進它。並且joe將他的 放在了github倉庫上。下面是你要做的事情 fork他的倉庫 這是github操作,這個操...

在vscode中使用git和github

這學期的團隊專案比較多,這裡?一下常用的git命令,免得每次都去查 init locally and push to github config your name and email git config global user.name abc git config global user.em...

socket在windows下和linux下的區別

1 標頭檔案 windows下winsock.h winsock2.h linux下sys socket.h 錯誤處理 errno.h 2 初始化 windows下需要用wsastartup wsadata wsadata err wsastartup 0x202,wsadata if err 0 ...