Category:Tools’

Useful CVS Commands

 - by joerg


cvs -q -n update #gives short status for changed files without actually updating
cvs update -C filename # revert filename to latest version

Git branch renaming & Git<>Mercurial Translations

 - by joerg
#rename local branch
git branch -m production prod_v1
 
#delete remote branch with old name
git push origin :production
 
#create remote renamed branch
git push origin prod_v1
 
#back to master
git checkout master
 
#create new branch with old name
git branch production
 
#push the "old" new branch
git push origin production
 
# local setup
git branch --set-upstream-to=origin/production production
git branch -d prod_v1 #removes local refs

Ref: stackoverflow.com/git-rename-remote-branch

For Mercurial Users: HG Translations

JBoss 7 Command line to shutdown

 - by joerg

To stop the Jboss Application Server from Console type following command:

jboss-cli.sh --connect command=:shutdown --controller=localhost:9998

Reporting affected files with Mercurial

 - by joerg

In file based environments sometimes it is necessary to know exactly which files are affected for a bunch of changes made to a branch. For an elegant view use this following command:

hg log -b your_branch_name --template '{files} ' | tr ' ' '\n' | sort | uniq

For a better solution please leave a comment :)

Vim column mode

 - by joerg

To activate column mode in vim press Ctrl-v. Now mark you desired columns and execute commands on it.

      #
 ////###  ///
  ///####  //
  ///#####//
  ///####//       For example ctrl-v starts column mode
 #///###//##
##///##//####     j marks the column below 
 #///#//####
  /////####       and r replaces the columns with the following character
  ////####
  ///####
  // ###
      #

Further useful commands in visual mode:

I inserts text before selection
A appends text after selection
s replaces block with typed text

To append text at the end of line use ctrl-v followed by $.