Last active
July 17, 2017 17:58
-
-
Save giripilgaonkar/f1a2ced7c2e3b8db81c164acf95ea1a2 to your computer and use it in GitHub Desktop.
git gitflow commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Show status of current changes | |
| git status | |
| # Revert a single file to the last commit | |
| git checkout <filename> | |
| # Checkout pull request from GitHub | |
| git fetch origin pull/<id>/head:<local-branchname-for-pr> | |
| git checkout <local-branchname-for-pr> | |
| # Pull latest changes from pull request from GitHub | |
| git pull origin pull/<id>/head:<remote-branchname-for-pr> | |
| # Fork own Repo from GitHub | |
| git clone https://github.com/userName/Repo New_Repo | |
| cd New_Repo | |
| git remote set-url origin https://github.com/userName/New_Repo | |
| git remote add upstream https://github.com/userName/Repo | |
| git push origin master | |
| git push --all | |
| #quick push commit | |
| git add . | |
| git commit -a -m "commit" (do not need commit message either) | |
| git push | |
| #Refresh old branches | |
| git fetch origin –prune | |
| git clean -fd | |
| # creates a new feature branch; prompts for the branch name which will take the format feature/<branch name>; pushes the branch to origin automatically so that we can do two things: 1) collaborate with others and 2) get Jenkins to build it | |
| mvn jgitflow:feature-start | |
| #merges a feature branch back into the dvlp branch and pushes to origin | |
| mvn jgitflow:feature-finish | |
| #creates a release branch (e.g. release/rev-5.1) and pushes it to origin | |
| mvn jgitflow:release-start | |
| #builds, tags and merges the release branch back into master and dvlp; updates versions in master and dvlp branches | |
| mvn jgitflow:release-finish | |
| #works like mvn jgitflow:release-start but branches off of master | |
| mvn jgitflow:hotfix-start | |
| #works like mvn jgitflow:release-finish | |
| mvn jgitflow:hotfix-finish | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-release-plugin</artifactId> | |
| <version>2.5.1</version> | |
| <dependencies> | |
| <dependency> | |
| <groupId>org.apache.maven.scm</groupId> | |
| <artifactId>maven-scm-provider-gitexe</artifactId> | |
| <version>1.9.2</version> | |
| </dependency> | |
| </dependencies> | |
| </plugin> | |
| <plugin> | |
| <groupId>external.atlassian.jgitflow</groupId> | |
| <artifactId>jgitflow-maven-plugin</artifactId> | |
| <version>1.0-m5.1</version> | |
| <configuration> | |
| <enableSshAgent>false</enableSshAgent> | |
| <autoVersionSubmodules>true</autoVersionSubmodules> | |
| <pushFeatures>true</pushFeatures> | |
| <pushReleases>true</pushReleases> | |
| <pushHotfixes>true</pushHotfixes> | |
| <noDeploy>true</noDeploy> | |
| </configuration> | |
| </plugin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment