update readme and some description

This commit is contained in:
Zoker 2020-07-11 10:33:08 +08:00
parent 249e90e00c
commit 1a4a897b6e
3 changed files with 26 additions and 18 deletions

View File

@ -6,13 +6,15 @@
### 功能特点 ### 功能特点
- [简单] 可自动在对应平台创建同名仓库并上传 - [简单] 可自动在对应平台创建同名仓库并上传
- [可靠] 可选择是否本地覆盖远程(如果同名仓库在远端已存在) - [可靠] 可选择是否本地覆盖远程(如果同名仓库在远端已存在)
- [灵活] 可通过多种方式导入仓库源(目录、文本列表) - [方便] 可选择上传到 Gitee 组织或者新建组织上传
- [灵活] 可通过多种方式导入仓库源目录、文本列表、Github 源)
- [快速] 并发5个同时操作各平台均有限制5个并发可保证成功率及速度 - [快速] 并发5个同时操作各平台均有限制5个并发可保证成功率及速度
### 注意事项 ### 注意事项
- 工具会自动生成临时的一个 Remote `up2GitX-{timestamp}` 进行推送,不会影响现有的 Remote 配置 - 工具会自动生成临时的一个 Remote `up2GitX-{timestamp}` 进行推送,不会影响现有的 Remote 配置
- 工具会调用OAuth授权进行仓库的创建后续可以在第三方应用管理取消授权 - 工具会调用OAuth授权进行仓库的创建后续可以在第三方应用管理取消授权
- 工具在进行处理的过程中会对特殊情况进行交互,请仔细阅读并慎重选择 - 工具在进行处理的过程中会对特殊情况进行交互,请仔细阅读并慎重选择
- Github 的镜像操作会生成临时目录来存储这些临时的裸仓库,同步完成后,自行删除即可
### 设计流程 ### 设计流程
@ -38,8 +40,10 @@ Global Options:
--no-color Disable color when outputting message --no-color Disable color when outputting message
-h, --help Display this help information -h, --help Display this help information
Arguments: Arguments:
repoSource Tell me which repo dir or list your want to sync, is required repoSource Tell me which repo dir or list your want to sync, is required
token Provide platform token for skip api rate limit
Examples: Examples:
Using dir: ./up2 gitee /Zoker/repos/ Using dir: ./up2 gitee /Zoker/repos/
@ -58,11 +62,16 @@ Examples:
/Zoker/workspace/git-work-repo2 /Zoker/workspace/git-work-repo2
/other/path/to/git-bare-repo3 /other/path/to/git-bare-repo3
... ...
Using Source: ./up2 gitee github:zoker YOUR_TOKEN_HERE(OPTIONAL)
Support import from Github source, replace {zoker} with your expected Github path
It better to provide your own access_token to avoid api rate limit, eg on Github: https://github.com/settings/tokens
Alert: Only Github source and public project supported, other platform like Gitlab, Bitbucket will be added later
``` ```
### 使用示例 ### 使用示例
这里以上传到 Gitee 为例 这里以上传到 Gitee 为例[镜像 Github 空间到 Gitee 示例](https://gitee.com/kesin/up2GitX/releases/v1.1.0)
#### 1、指定 RepoSource #### 1、指定 RepoSource
@ -74,9 +83,9 @@ Examples:
#### 2、输入 Gitee 账号信息并选择同步到哪个 Namespace #### 2、输入 Gitee 账号信息并选择同步到哪个 Namespace
![输入图片说明](https://images.gitee.com/uploads/images/2020/0613/174031_79068a5e_62561.png "2.png") ![输入图片说明](https://images.gitee.com/uploads/images/2020/0711/102903_f774ef30_62561.png "屏幕截图.png")
输入注册 Gitee 所用的邮箱以及密码,认证成功后会列出可用的 Namespace在 Gitee 上,它可以是个人名下、组织名下或者企业名下。(目前仅支持上传到个人名下,后续接口功能到位会支持组织和企业) 输入注册 Gitee 所用的邮箱以及密码,认证成功后会列出可用的 Namespace你也可以选择新建一个组织。在 Gitee 上,它可以是个人名下、组织名下或者企业名下。(目前仅支持上传到个人和组织,后续接口功能到位会支持企业)
#### 3、确认将要生成的仓库链接并选择公开属性 #### 3、确认将要生成的仓库链接并选择公开属性

View File

@ -277,12 +277,11 @@ func createGroup(token string) []string {
if result, _, err := share.PostFormByte(orgUrl, paramsJson); err == nil { if result, _, err := share.PostFormByte(orgUrl, paramsJson); err == nil {
orgRes, _ := simplejson.NewJson([]byte(result)) orgRes, _ := simplejson.NewJson([]byte(result))
login, _ := orgRes.Get("login").String() login, _ := orgRes.Get("login").String()
errorMsg, _ := orgRes.Get("message").String()
if login == orgPath { if login == orgPath {
color.Green.Printf("\nGroup https://gitee.com/%s has been successfully Created!\n", orgPath) color.Green.Printf("\nGroup https://gitee.com/%s has been successfully Created!\n", orgPath)
return []string{orgPath, orgPath, "Group"} return []string{orgPath, orgPath, "Group"}
} else { } else {
color.Red.Println(errorMsg) color.Red.Println(orgRes)
} }
} else { } else {
color.Red.Println(err.Error()) color.Red.Println(err.Error())

View File

@ -429,7 +429,7 @@ func AskPublic(npType string) string {
func AskError() string { func AskError() string {
howTo := []string{"Exit and fix them", howTo := []string{"Exit and fix them",
"Skip them"} "Skip them"}
ques := "There are errors on some dirs, what would you like to do?" ques := "There are errors on some projects, what would you like to do?"
return selectOne(howTo, ques) return selectOne(howTo, ques)
} }