[TOC]
## 配置公鑰
` `使用`ssh-keygen -t rsa -C xxxx`生成公鑰。其中xxxx表示gitee賬戶。

` `使用`cat ~/.ssh/id_rsa.pub`查看生成的公鑰。

` `打開Gitee進入個人設置,拷貝剛剛cat顯示的公鑰,填入。

` `添加后可以看到自己添加的公鑰。

## 新建gitee項目
` `和GitHub類似。

## 配置遠程庫關聯
` `若本地項目之前沒有配置git,首先執行`git init`進行初始化。

` `然后執行`$ git remote -v`查看本地關聯的遠程庫,如果沒有任何關聯,可以執行`$ git remote add gitee 倉庫地址`添加遠程庫。獲取倉庫地址和github一樣。

*****
**注意:**如果存在說明當前目錄之前關聯過Git遠程庫,可以在一個新的目錄執行`$ git init`初始化一個新的本地倉庫,也可以執行`$ git remove rm "XXX"`刪除, 還可以再添加一個不重名的遠程庫。
提交的時候指定push,例:`$ git push gitee master`,這樣一來,我們的本地庫就可以同時與多個遠程庫互相同步:

## 同步工程
` `使用`git pull gitee master`將遠程工程同步到本地,然后本地工程進行修改,使用`git status`查看當前的代碼修改情況,使用`git add .`將變更的文件添加到本地git庫,然后使用`git commit -m "說明"`添加修改說明,接著使用`git push gitee master`將修改后的項目推送到遠程gintee上。
## 新建工程后的同步操作流程
```[flow]
start=>start: 開始
op1=>operation: git init
op2=>operation: git remote add gitee +倉庫地址
op3=>operation: git pull gitee master
op4=>operation: git status
op5=>operation: git add .
op6=>operation: git commit -m "說明"
op7=>operation: git push gitee master
end=>end: 結束
start->op1(right)->op2(right)->op3(bottom)->op4(bottom)->op5(bottom)->op6(bottom)->op7(bottom)->end
```
## 已有工程的同步操作
```[flow]
start=>start: 開始
op3=>operation: git pull gitee master
op4=>operation: git status
op5=>operation: git add .
op6=>operation: git commit -m "說明"
op7=>operation: git push gitee master
end=>end: 結束
start->op3(right)->op4(right)->op5(bottom)->op6(bottom)->op7(bottom)->end
```
## 關于Git commit
` ` git commit 主要是將暫存區里的改動給提交到本地的版本庫。每次使用git commit 命令我們都會在本地版本庫生成一個40位的哈希值,這個哈希值也叫commit-id。
` `commit-id在版本回退的時候是非常有用的,它相當于一個快照,可以在未來的任何時候通過與git reset的組合命令回到這里.
## linux上傳至gitee的腳本
為了使得每次同步到云端倉庫更簡單,自己寫了一個腳本:
```bash
#!/usr/bin/env bash
#UFUNCTION=自動同步當前項目至gitee倉庫
pwd
git status
git add .
if [ $# -gt 0 ];then
git commit -m "$*"
else
dat=$(date +%Y/%m/%d\ %H:%M:%S)
git commit -m "$dat"
fi
git push gitee master
```
- 第1章 電腦操作篇
- 1.1 電腦高清壁紙下載地址
- 1.2 音樂外鏈在線獲取
- 1.3 markdown,js等表格生成神器
- 1.4 在線使用文檔,表格,演示文檔
- 1.5 開發在線工具
- 1.5.1 toolbox
- 1.5.2 菜鳥工具
- 1.6 vs code遠程調試
- 1.7 windows批處理命令
- 1.8 windows安裝cygwin運行linux指令
- 1.9 windows下某些程序運行慢
- 1.10 win下為鼠標右鍵添加新項目
- 1.11 win上自己常用的開發軟件
- 1.12 win下vscode配置
- 第2章 Electron 用前端技術開發跨平臺桌面應用
- 2.1 介紹
- 2.2 入門鏈接地址
- 2.3 cnpm使用
- 第3章 Git使用
- 3.1 介紹
- 3.2 同步GitHub的基本使用方法
- 3.3 同步Gitee的基本使用方法
- 3.4 獲取當前git分支
- 3.5 LF和CRLF換行的轉換
- 第4章 HTML,CSS,JS
- 4.1 HTML速查列表
- 第5章 python使用
- 5.1 文件操作
- 5.2 一句話建立服務器
- 第6章 我的女友叫Linux
- 6.1 使用shell寫俄羅斯方塊
- 6.2 那些有趣的shell
- 6.2.1 40個有趣的LInux命令行
- 6.2.2 命令行下的網易云搜索播放器
- 6.2.3 從網上獲取一條語句并顯示
- 6.3 在linux上寫匯編
- 6.4 在linux終端連接另一臺linux
- 6.5 makefile文件的編寫
- 6.6 deepin掛載遠程文件夾到本地文件夾
- 6.7 本地lnux和遠程linux進行文件拷貝
- 6.8 超好用的linux下的ssh管理工具(electerm)
- 6.9 那些不重要的技巧
- 6.10 linux文件加密
- 6.11 論文畫圖軟件gnuplot
- 6.12 自定義mrun命令用于執行當前路徑下的run文件
- 6.13 fish shell后臺運行程序
- 第7章 在線工具收集
- 7.1 各種編程語言的在線編輯運行
- 7.2 html js 在線嘗試
- 第8章 搭建自己的私有云盤
- 第9章 linux下的一些軟件
- 9.1 remarkable--markdown文件輕量編輯器
- 9.2 gnuplot畫圖軟件
- 9.3 Graphviz繪圖(流程圖,狀態圖)
- 第10章 TCL腳本編程
- 10.1 基礎教程
- 10.2 在tcl腳本文件其他tcl腳本文件運行
- 10.3 在tcl腳本文件中調用bash/fish
- 10.4 TCL培訓教程
- 10.5 tcl腳本參數傳遞
- 第11章 看云的使用
- 11.1 markdown添加公式
- 11.2 看云在linux本地編輯腳本
- 第12章 Go語言在linux下的使用
- 12.1 簡介
- 12.2 調用自己的包
- 12.3 Go語言學習的資料
- 12.4 golang使用flag完成命令行解析
- 12.5 Golang文件操作大全
- 12.5.1 創建空文件
- 12.5.2 Truncate文件
- 12.5.3 得到文件信息
- 12.5.4 重命名和移動
- 12.5.5 刪除文件
- 12.5.6 打開和關閉文件
- 12.5.7 檢查文件是否存在
- 12.5.8 檢查讀寫權限
- 12.5.9 改變權限、擁有者、時間戳
- 12.5.10 硬鏈接和軟鏈接
- 12.5.11 復制文件
- 12.5.12 跳轉到文件指定位置(Seek)
- 12.5.13 寫文件
- 12.5.14 快寫文件
- 12.5.15 使用緩存寫
- 12.5.16 讀取最多N個字節
- 12.5.17 文件追加內容
- 12.6 操作CSV文件
- 第13章 搜集資源的一些方法
- 13.1 電子書_電子課本
- 第14章 EndNote的使用
- 14.1 安裝
- 14.2 文件檢索