# DSTY - jenkins-std-lib (Shared Library) - Easier way to checkout code and interact with git/svn

**URL:** <https://community.jenkins.io/t/dsty-jenkins-std-lib-shared-library-easier-way-to-checkout-code-and-interact-with-git-svn/236>\
**Category:** Showing Off\
**Created:** [July 7, 2021, 11:57am UTC](https://community.jenkins.io/t/dsty-jenkins-std-lib-shared-library-easier-way-to-checkout-code-and-interact-with-git-svn/236 "2021-07-07T11:57:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadycuz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/shadycuz/32/196_2.png) [@shadycuz](https://community.jenkins.io/u/shadycuz)\
**Post date:** [July 7, 2021, 11:57am UTC](https://community.jenkins.io/t/dsty-jenkins-std-lib-shared-library-easier-way-to-checkout-code-and-interact-with-git-svn/236/1 "2021-07-07T11:57:11Z")

</div>

DontShavetheYak jenkins-std-lib can be found [here](https://github.com/DontShaveTheYak/jenkins-std-lib) on GitHub.

PR for the new package is [here](https://github.com/DontShaveTheYak/jenkins-std-lib/pull/99).

New features:

- git.localBranches() - Return `List` of branch names available locally.
- git.remoteBranches() - Return `List` of branch names available remotely.
- git.tags() - Return `List` of all tags.
- git.changedFiles(target: ‘develop’) - Return `List` of changed files from the current branch to the `target` branch.
- git.changeBranch(‘develop’) - Change to a different branch.
- git.withBranch(‘develop’) { } - Temporarily switch to a branch and run the code inside `{ }`

See the example [job](https://github.com/DontShaveTheYak/jenkins-std-lib/blob/b06359bef40ffa412314d58dbce617142fc53ced/jobs/scm/git_example.groovy)

Comments and feedback are always welcome. Will probably merge over the weekend or so.

You can see a demo of other features on [youtube](https://youtu.be/H9SVZxolFOs) or the [docs](https://javadoc.io/doc/io.github.dontshavetheyak/jenkins-std-lib).
