Github入門

GitHub Learning Lab
官網https://lab.github.com/courseshtml

Git經常使用命令git

 1 // git在本地建立倉庫
 2 git init
 3 echo "Hello World!" > README.md
 4 git add -A
 5 git commit -m "my first commit"
 6 // 而後去Github建立一個倉庫"luren"
 7 git remote add origin https://github.com/xiaoming/luren.git
 8 git push -u origin master
 9 
10 
11 // 若是遠程倉庫更新了而本地沒同步,先pull再在本地解決衝突,以後merge
12 git pull origin master
13 git branch -a
14 git merge remotes/origin/master
15 git push -u origin master
16 
17 // 若是提示refusing to merge unrelated histories(固然你得肯定是這個倉庫)
18 git pull origin master --allow-unrelated-histories
19 
20 // 若是提示 而你不想git修改你的文件,能夠從全局關掉它
21 // 更多換行符設置詳見https://www.hhcycj.com/post/item/264.html
22 git config --global core.autocrlf false
23 
24 // git 推送代碼到已有倉庫
25 git add -A
26 git commit -m "add new Function"
27 git push -u origin master
View Code

 Git客戶端華爲鏡像源下載github

 

 注:關於Github課程chrome

This branch has not been deployed

No deployments
 
 

Review required

At least 1 approving review is required by reviewers with write access. Learn more.
 
Merging is blocked
Merging can be performed automatically with 1 approving review.

這個合併報錯並不是操做失誤,而是管理課程的人加了審覈windows

 

因此必須仔細看,最好不要關掉這個頁面 。第三節時會在Pull Requests和你繼續教程內容緩存

Tips:在頁面的chrome開發工具打開時 ,鼠標按住刷新鍵能夠選擇強制刷新模式(不使用緩存)安全

此外Git還有不少功能 ,如submodule能夠定義手動同步上游模塊。(微軟最新的終端項目倉庫就用了這個東西,節省了託管服務器帶寬)服務器

 

 

附上安全解決git報錯(push declined due to email privacy restrictions)hexo

git報錯-->! [remote rejected] master -> master (push declined due to email privacy restrictions) - 小輝輝的博客 - CSDN博客
附上爲本地代碼新建倉庫並推送本地代碼到遠程倉庫:app

github入門到上傳本地項目 - 偷偷有碼 - 博客園

git-push到多個遠程倉庫,github,coding - mbinary - CSDN博客

Git經常使用命令大全,迅速提高你的Git水平 

 

 

 GitHub 第一坑:換行符自動轉換 [Windows用戶必看]

 

 

Linux中apt與apt-get命令的區別與解釋 - 系統極客

 

如何使用 GitHub? - 知乎

 

 

Github 多帳號配置

 

若是團隊常常使用100M以上的單文件,建議看: Git LFS的使用 

 

另外,關於獲取指定commit的記錄

https://stackoverflow.com/questions/3489173/how-to-clone-git-repository-with-specific-revision-changeset

有趣的用法:創建靜態博客網站

   ·雖然是靜態的,可是引用一些js以後,連目錄檢索和評論功能都能擁有

https://hexo.io/zh-cn/docs/

 

 參考:https://zhuanlan.zhihu.com/p/60578464

轉載於:https://www.cnblogs.com/yucloud/p/10604130.html