This is a plugin intended to work with other plugins to help establish a Git workflow for a project.
gradlew assemble
apply plugin: com.mooregreatsoftware.gradle.gitplugin.GitPlugin
buildscript {
repositories {
add(new org.apache.ivy.plugins.resolver.URLResolver()) {
name = 'gitplugin_repo'
addArtifactPattern "http://github.com/downloads/jdigger/gradle_git_plugin/[module]-[revision](-[classifier]).[ext]"
descriptor = 'optional'
}
}
dependencies {
classpath 'com.mooregreatsoftware.gradle:gitplugin:1.1.0'
}
}
Look at bug system/cards and start developing against ISSUE-1234
gradle start1234
You can specify the prefix used in creating the branch name (e.g., 'ISSUE-') by setting the branchPrefix
property in the project. It will try to figure out the current integration branch (e.g., 'origin/master') based on the branch you are currently on, but if you want to explicitly specify it, set the integrationBranch
property in the project.
Work the issue. I'm paranoid that my machine will eat the files, but I want to make sure no-one else on my team will base any work off of my checkins.
gradle push-private
That will create the branch "work/jmoore/ISSUE-1234" on the server. You can customize the behavior of how the work branch is created by setting the baseWorkBranchName
property on the project. The default name is work
. Or, if you don't want to use the convention, specify workBranch
on the project to be whatever you want.
When I want to make sure that I have the latest from the integration branch and rebase my work against it.
gradle update
I'm ready for others to review my changes before putting into into the "golden integration branch".
gradle push-review
That will create the branch "review/master/ISSUE-1234" on the server. You can customize the behavior of how the review branch is created by setting the baseReviewBranchName
property on the project. The default name is review
. Or, if you don't want to use the convention, specify reviewBranch
on the project to be whatever you want.
Rinse and repeat.
Checkout another developer's code.
git review3456
equivalent to
git checkout -b ISSUE-3456 origin/review/master/ISSUE-3456
Everything looks great.
gradle push-integration
Pull remote changes from the currently tracked branch into the current branch.
Push changes to a private branch on the server.
Push changes to a branch that can be shared with other developers.
Push changes to a branch used for doing code-reviews.
Push changes to the integration branch others base their work from.
Change the local branch to track the "working" (i.e., shared) branch.
Change the local branch to track the code-review branch.
Change the local branch to track the integration branch.
Remove the remote private development branch for the current issue.
Remove the remote shared development branch for the current issue.
Remove the remote code-review branch for the current issue.
Removes references to remote branches that no longer exist.
These plugins were written by Jim Moore. They are published at GitHub:jdigger/gradle_git_plugin.
All these plugins are licensed under the Apache Software License 2.0 license with no warranty (expressed or implied) for any purpose.