Skip to content

Latest commit

 

History

History
38 lines (22 loc) · 875 Bytes

README.md

File metadata and controls

38 lines (22 loc) · 875 Bytes

vit

Another Git wrapper

Installation

This module depends on uwu

Clone this repository in your V modules folder:

git clone https://github.com/onerbs/vit ~/.vmodules/vit

Usage

Initialize a new repository, commit and push.

import vit.repo
import vit.uri

fn main() {
	mut repo := repo.init() ?           // `git init`

	repo.stage('LICENSE') ?             // `git add LICENSE`
	repo.commit('Add LICENSE') ?        // `git commit -m "Add LICENSE"`

	host := uri.github('sample')        // See the available hosts on `uri/hosts.v`
	url := host.ssh()                   // "git@github.com:user/sample.git"

	                                    // `git remote add origin git@github.com:user/sample.git`
	origin := repo.add_remote('origin', url) ?

	origin.push_upstream() ?            // `git push -u origin main`
}