Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Friday, March 26, 2021

Friday, January 20, 2017

Tuesday, December 27, 2016

Git: apply pull request as patch

curl -L https://github.com/monero-project/monero/pull/1507.patch | git apply -v -

Tuesday, July 29, 2014

Git: Show updated tree of branches in console

To do this, just add the following to ~/.gitconfig[alias]
  tree = log --graph --all --decorate --pretty=oneline --abbrev-commit
Then git tree will give text based tree of branches:

To run git tree in console showing e.g. 20 latest commits we can run git tree in a while loop as follows: while true; do clear; git tree -20; sleep 2; done

Saturday, July 20, 2013

ImageJ: Import source code into Eclipse and git version control

ImageJ is a public domain Java image processing program inspired by NIH Image for the Macintosh. It runs, either as an online applet or as a downloadable application, on any computer with a Java 1.4 or later virtual machine. Downloadable distributions are available for Windows, Mac OS, Mac OS X and Linux.
Since it is open sourced it can be modified and extended. It normally comes with ant build.xml but I usually work with Eclipse and Git, thus I wanted to work with the source files in this environment.

I will show how to add ImageJ source code into Eclipse and with Git support. The steps below where executed in Xubuntu 13.04.

1. Download the source code and unpack

The ImageJ source code is here. At the moment of writing, the latest version is ij147v-src.zip I usually download to ~/Downloads folder. To unpack it use the following:cd ~/Downloads/
unzip ij147v-src.zip
This will create a folder named source in ~/Downloads.

2. Create new Java Project in Eclipse

Create new Java Project in your default workspace. Usually the folder is set by Eclipse as ~/workspace. Its important to select "Use project folder as root for sources and class files" because in a moment we will import the ImageJ source into it.





Tuesday, July 26, 2011

Git: change commit editor to vim

This command can be used:git config --global core.editor "vim"or one can setup environment variable GIT_EDITOR:export GIT_EDITOR="vim"

Sunday, June 26, 2011

Git: last commit date

To obtain date and time of the last commit in a current branch one can use git log command: git log -1 --format="%cd"