воскресенье, 24 мая 2015 г.

Create global git shortcuts for Windows

Add desired shortcuts to the file .profile in folder C:\Users\<user-name>
For example,
alias gl='git log '
alias gs='git status '
alias ga='git add '
alias ga-='git reset HEAD '
alias gb='git branch '
alias gc='git commit '
alias gc-='git reset --soft HEAD^ '
alias gd='git diff '
alias go='git checkout '
alias pull='git pull '
alias push='git push '
alias gcl='git reset --hard HEAD '

http://githowto.com/aliases

Run git commands from BAT file

Run git commands from BAT file
call c:/dev/git/cmd/git.exe checkout -- c:/dev/workspace/app-ui/temp.css

Eclipse integration with Maven projects

Maven Eclipse Plugin is used to generate Eclipse IDE files
mvn eclipse:eclipse
mvn eclipse:clean

https://maven.apache.org/plugins/maven-eclipse-plugin/

Resolve source code and Javadocs with Maven

To resolve source code and Javadocs for your library dependencies in Maven use
mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc

Map inline initialization in Java

You can't initialize map in-line in Java, you will have to add all the elements manually or use Guava
Map<String, Integer> left = ImmutableMap.of("a", 1, "b", 2, "c", 3);

понедельник, 6 апреля 2015 г.

Rebase a branch in git

How to rebase a branch in git?
You can rebase the other branch on top of the base branch by running


git rebase baseb_ranch_name feature_branch_name
 

More about rebasing http://git-scm.com/book/ch3-6.html

Reset last commit in git without losing its changes

How to reset the last commit in git without losing its changes?

git reset --soft HEAD^ 

This resets the head to previous commit and leaves all your changed files staged.

Link to documentation http://git-scm.com/docs/git-reset