GithubHelp home page GithubHelp logo

kgit's Introduction

KGit

GitHub release (latest by date) maven-central ktlint

KGit is Kotlin Wrapper Library of JGit.

  • Null Safety Methods
  • Command Settings Available Using Lambda Function (No Method Chain)
  • Support JGit features: 6.7.0.202309050840-r

Examples

Clone Repository

JGit

val git: Git = Git.cloneRepository()
                  .setURI("https://github.com/sya-ri/KGit")
                  .setTimeout(60)
                  .setProgressMonitor(TextProgressMonitor())
                  .call()

KGit

val git: KGit = KGit.cloneRepository {
    setURI("https://github.com/sya-ri/KGit")
    setTimeout(60)
    setProgressMonitor(TextProgressMonitor())
}

Installation

Tip

  • KGit bundles org.eclipse.jgit:org.eclipse.jgit.
  • Install the jgit extension library if necessary.

build.gradle

repositories {
    mavenCentral()
}

dependencies {
    implementation 'com.github.sya-ri:kgit:1.0.6'
}

build.gradle.kts

repositories {
    mavenCentral()
}

dependencies {
    implementation("com.github.sya-ri:kgit:1.0.6")
}

Develop

Git Commit

Before Commit

Run the gradle task to check the code format.

gradle lintKotlin

Template

<type>: <subject>

Type

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing or correcting existing tests
  • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation

kgit's People

Contributors

dependabot-preview[bot] avatar sya-ri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kgit's Issues

Auth example

Please add an authentication example to the git repository. Without this, there is no point in using the library.
I'm trying to clone a repository and I'm getting an error "unresolved reference"

In general, I just don’t understand what needs to be done to authenticate using this library.

val git: KGit = KGit.cloneRepository {
    setURI("ssh://[email protected]:7999/project/reponame.git")
    setBranchesToClone(listOf("refs/heads/develop"))
    setBranch("refs/heads/develop")
    setCredentialsProvider(UsernamePasswordCredentialsProvider("user", "password"))
    setTransportConfigCallback { transport ->
        val sshTransport = transport as? SshTransport
        sshTransport?.sshSessionFactory = sshSessionFactory;
    }

    var sshSessionFactory: SshSessionFactory =
        object : org.gradle.internal.impldep.org.eclipse.jgit.transport.JschConfigSessionFactory() { <<-- unresolved reference
            protected fun configure(host: Host?, session: Session?) {
                // do nothing
            }
        }
}

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.