Coder Social home page Coder Social logo

alibaba / git-repo-go Goto Github PK

View Code? Open in Web Editor NEW
247.0 11.0 57.0 1.12 MB

git-repo is a command-line tool for centralized workflow, can work with Gerrit, AGit-Flow compatible servers. It is written in Golang, and it can be installed easily without further dependency. It provides an easy-to-use solution for multiple repositories which is introduced by Android repo first, and it can also work with a single repository.

Home Page: https://git-repo.info/

License: Apache License 2.0

Makefile 1.95% Shell 48.61% Go 44.68% Perl 3.42% Python 1.34%
agit-flow git-repo

git-repo-go's Introduction

Build Status

git-repo

repo reimplemented in Golang and many others

git-repo is repo reimplemented in Golang and with many other features. Using git-repo, a developer can create code reviews (pull requests) from client side directly. There will be no fork, no feature branches, and no write permission needed.

git-repo is a command line tool, which adds more sub-commands to git, and works for centralized git workflow like Gerrit, agit-flow of Alibaba.com, and other agit-flow alike protocols...

Installation

Download or compile the binary of git-repo from this repository, and install (copy) the executable of git-repo to proper location, such as /usr/bin of Linux and MacOS, and C:\Windows\system32 of Windows.

After installation, execute the following command to validate the installation:

git repo version

Git aliases installed from git-repo

git-repo installs some useful git configurations for user, some unique alias commands are:

git peer-review => git repo upload --single
git pr => git repo upload --single
git download => git repo download --single

Single repository mode

Create code-review directly from client side

  1. Clone a repository

     git clone https://codeup.teambition.com/gotgit/demo.git
    
  2. Create a local branch (optional)

     git checkout -b some/topic origin/master
    
  3. Create commits in worktree...

  4. Create code-review from command line:

     git pr
    

There are many options for git pr (or git peer-review, or git review), please check the manual:

    git repo upload --help

Download code-review to local repository for review

A new code-review (pull request) will be created or a old code-review will be refreshed after running git pr. Each code-review has a unique number, such as pull request #123.

Reviewer can download it using command

git download 123

, and make a code review in local worktree.

Update code-review

Repeated command by author will update the code review:

git pr

If a reviewer wants to update a code-review, he or she can run:

git pr --change 123

(suppose 123 is the code review ID, the reviewer just downloaded)

Multiple repositories

git-repo supports android style multiple repositories management.

  • Init workspace from a manifest project.

      git repo init <manifest-url>
    
  • Clone / update all repositories referenced in the manifest repository.

      git repo sync
    
  • Create a local working branch instead of detached HEAD on all repositories.

      git repo start --all some/topic
    
  • Send changes to remote server to create code reviews.

      git repo upload
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.