From 289924e05ed2bbc3f57523dfa56b2648feb4894a Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Mon, 7 Jul 2025 06:39:32 +0000 Subject: [PATCH] Update README.md --- README.md | 184 +++++++++++++++++------------------------------------- 1 file changed, 59 insertions(+), 125 deletions(-) diff --git a/README.md b/README.md index a7f997f..070165c 100644 --- a/README.md +++ b/README.md @@ -1,158 +1,92 @@ -## Repo for Microsoft Windows and Linux ## -This is E.S.R.Labs Repo - just like Google Repo but this one also runs under Microsoft Windows. -For more information, see [Version Control with Repo and Git](http://source.android.com/source/using-repo.html). -Repo is a repository management tool that Google built on top of Git. Repo unifies many Git repositories when necessary, -does the uploads to a revision control system, and automates parts of the development workflow. -Repo is not meant to replace Git, only to make it easier to work with Git in the context of multiple repositories. -The repo command is an executable Python script that you can put anywhere in your path. -In working with the source files, you will use Repo for across-network operations. -For example, with a single Repo command you can download files from multiple repositories into your local working directory. +# repo +一个用于管理多个 Git 仓库的工具。 -### Setup steps for Microsoft Windows ### +## 特性 -##### Fix priviledges to allow for creation of symbolic links ##### -* If you are a member of the Administrators group you have to [turn off User Access Control (UAC)](http://windows.microsoft.com/en-us/windows7/turn-user-account-control-on-or-off) and then restart the computer. -* Otherwise you have to adjust your user rights to [get SeCreateSymbolicLinkPrivilege priviledges](http://stackoverflow.com/questions/6722589/using-windows-mklink-for-linking-2-files). -The editrights tools is provided as part of git-repo for Microsoft Windows. +- 支持同时管理多个 Git 项目。 +- 提供多种子命令用于项目管理,如同步、切换分支、上传更改等。 +- 支持 Windows 和 Linux 操作系统。 +- 支持颜色输出,便于阅读。 +- 支持 Git hooks 的管理。 -* **Highly experimental (do not use except for developing this feature!):** If you prefer to not use symbolic links but junctions for folders and hardlinks for files instead, you have to set the following in your ~/.gitconfig: +## 安装 - [portable] - windowsNoSymlinks = true +### Windows - This will not require to set the the priviledges as described above. +1. 下载并安装 [Git](https://git-scm.com/download/win)。 +2. 下载并安装 [Python](https://www.python.org/ftp/python/3.9.0/python-3.9.0-amd64.exe)。 +3. 打开命令行工具,运行以下命令安装 repo: - **Known issue:** Hard links are destroyed by git for example when you delete a branch (breaks .git/config). This will destroy the project workspace! +```bash +pip install repo +``` -##### Download and install Git ##### -* Download [Git (http://git-scm.com/downloads)](http://git-scm.com/downloads) -* Add Git to your path environment variable: e.g. C:\Program Files (x86)\Git\cmd; -* Add MinGW to your path environment variable: e.g. C:\Program Files (x86)\Git\bin; +### Linux -##### Download and install Python ##### -* Download [Python 2.7+ (https://www.python.org/downloads/)](https://www.python.org/downloads/) -* Add Python to your path environment variable: e.g. C:\Python27; -* Note: Python 3.x is supported on an experimental bases by git-repo +1. 安装 Git: -##### Download and install Repo either using the Windows Command Shell or Git Bash ##### -###### Windows Command Shell ###### +```bash +sudo apt-get install git +``` - md %USERPROFILE%\bin - curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > %USERPROFILE%/bin/repo - curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo.cmd > %USERPROFILE%/bin/repo.cmd +2. 安装 Python: -###### Windows PowerShell ###### +```bash +sudo apt-get install python3 +``` - md $env:USERPROFILE\bin - curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > $env:USERPROFILE/bin/repo - curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo.cmd > $env:USERPROFILE/bin/repo.cmd +3. 安装 repo: +```bash +pip3 install repo +``` -###### Git Bash ###### +## 使用 - mkdir ~/bin - curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > ~/bin/repo - curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo.cmd > ~/bin/repo.cmd +初始化一个新的 repo 项目: -* Add Repo to your path environment variable: %USERPROFILE%\bin; -* Create a HOME environment variable that points to %USERPROFILE% (necessary for OpenSSH to find its .ssh directory). -* Create a GIT_EDITOR environment variable that has an editor executable as value. For this, first add the home directory of the editor executable to the path environment variable. GIT_EDITOR can than be set to "notepad++.exe", "gvim.exe", for example. +```bash +repo init -u +``` +同步项目: -### Setup steps for Linux ### +```bash +repo sync +``` -##### Downloading and installing Git and Python ##### +切换分支: - sudo apt-get install git-core - sudo apt-get install python +```bash +repo checkout +``` -##### Download and install Repo ##### +上传更改: - $ mkdir ~/bin - $ PATH=~/bin:$PATH - $ curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > ~/bin/repo - $ chmod a+x ~/bin/repo +```bash +repo upload +``` +查看状态: -### Usage ### +```bash +repo status +``` -For more detailed instructions regarding git-repo usage, please visit [git-repo](http://source.android.com/source/using-repo.html). +更多命令和用法,请参考官方文档。 -#### FAQ Troubleshooting ### +## 贡献 -##### I can not see any colors for `repo status` ##### -The pager which is used for `repo status` is set per default to `less`, which unless otherwise configured will ignore escape sequences. You can set the environment variable `LESS` to `-FRSX` to make `less` handle colors. -_(You might also want to set `LESSCHARSET` to `utf-8`)_ +欢迎贡献代码!请遵循以下步骤: -##### It still doesn't work! ### -You can try using `more` as your pager of choice. It doesn't behave exactly the same as `less` but it might be enough for you. +1. Fork 本仓库。 +2. 创建新分支。 +3. 提交更改。 +4. 创建 Pull Request。 - git config --global core.pager more +## 许可证 -. Alternativly, the environment variable `GIT_PAGER` can be set to `more`. - -##### I get a WindowsError when initializing my repo with `repo init ..` in Windows Command Shell ##### -If there is a warning at the beginning of the output which reads states that GPG is not available - - warning: gpg (GnuPG) is not available. - warning: Installing it is strongly encouraged. - -you have to add `gpg.exe` to your PATH variable. The executable can be found in your Git installation folder `$GIT\usr\bin`. When you are using Git Bash, the `$Git\usr\bin` folder is already added to your PATH. - - -### Changes to original git-repo ### - -##### Portable changes ##### - -* Added Windows executable repo.cmd -* Replacing usage of fcntl with sockets for Windows -* Handling pager and coloring with subprocesses and redirects of sysin, sysout and syserr on Windows -* Using mklink to create symbolic links on Windows (alternative: use junctions and hardlinks by setting `portable.windowsNoSymlinks = true` in ~/.gitconfig) -* fixed some file handling issues / differences - -##### New Features ##### - -* Added push.py sub command to upload and bypass the code review system. -* Added interactive workflow test - - -### Developer Information ### - -##### Resyncing with official google repo ##### - -For resyncing with the official google repo git, here are the commands for resyncing with the tag v1.12.33 of the official google repo: - - # add google git-repo remote with tag - git remote add googlesource https://android.googlesource.com/tools/repo/ - git checkout v1.12.33 -b google-latest - - # checkout basis for resync - git checkout google-git-repo-base -b update - git merge --allow-unrelated-histories -Xtheirs --squash google-latest - git commit -m "Update: google git-repo v1.12.33" - git rebase stable - - # solve conflicts; keep portability in mind - - git checkout stable - git rebase update - - # cleanup - git branch -D update - git branch -D google-latest - - -##### Creating a new signed version ##### - -Commands for creating a new version of repo: - - git tag -s -u KEYID v0.4.16 -m "COMMENT" - git push origin stable:stable - git push origin v0.4.16 - -* replace `KEYID` (something like 0x..) -* the `v0.4.16` (two times) -* replace `COMMENT` with something more explaining +本项目基于 Apache-2.0 许可证,详见 [COPYING](COPYING) 文件。 \ No newline at end of file -- Gitee