↓ Skip to main content

Git

Merge conflict with deleted file

·335 words·2 mins
I was merging the branch that removed / consolidated bunch of duplicate JSP files (corporate-ui-cleanup). In the meantime in master, some minor UI changes were made to these files whose content was now elsewhere. Quick trick how to resolve it fast: Show branch # CineplexB2B $ git show-branch ! [bb-database-cleanup] Loading data with XML only: no constraints and tax_id (unused field) nullable ! [bb-gradle-build] Merge branch 'master' into bb-gradle-build * [bb-master] Merged in the last 5 days changes ! [corporate-ui-cleanup] Merged in the last 5 days changes ! [master] Merged in the last 5 days changes ----- - [bb-gradle-build] Merge branch 'master' into bb-gradle-build ---- [bb-master] Merged in the last 5 days changes +*++ [bb-master^2] CPLXB2B-562, usageInfo/internalUsageInfo mapping in CFI +*++ [bb-master^2^] return order goes all the way to NEW: replaced SetPaymentGroupAmount, added ReturnFee calculator, added reusable jsp fragments for sales order pages +*++ [bb-master^2~2] Styling change to avoid disappearing links inside Terms and Conditions +*++ [bb-master^2~3] Dealing with consequences if INTERNAL split to INTERNAL_TRANSFER and INTERNAL_PURCHASE ---- [bb-master^2~4] Merge remote-tracking branch 'origin/master' into uat2-deploy ---- [bb-master^2~4^2] Merge branch 'master' of luke:cineplex-b2b +*++ [bb-master^2~4^2^] merged changes - fixed conflict +*++ [bb-master^2~4^2~2] CPLXBTOB-557 - fixed amount column to show proper currency ---- [bb-master^2~4^2~3] Merge branch 'master' of twgit@luke:cineplex-b2b.git +*++ [bb-master^2~4^2~4] CPLXBTOB-484 - fixed the spacing and comma issues +*++ [bb-master^2~5] Reverted 4d512ed - issue with recalculate. Must be solved selectively via Javascript +*++ [bb-master^2~6] Spacing in header see also version with --current

Dot-vimming new machine

New MacMini # MacMini:~ mediaserver$ mkdir .vim MacMini:~ mediaserver$ git clone git@github.com:radegast/dotvim.git .vim Cloning into '.vim'... The authenticity of host 'github.com (207.97.227.239)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts. remote: Counting objects: 367, done. remote: Compressing objects: 100% (309/309), done. remote: Total 367 (delta 58), reused 335 (delta 26) Receiving objects: 100% (367/367), 512.73 KiB, done. Resolving deltas: 100% (58/58), done. MacMini:~ mediaserver$ cd .vim MacMini:.vim mediaserver$ pwd /Users/mediaserver/.vim MacMini:.vim mediaserver$ ln -s ~/.vim/_vimrc ~/.vim .vim/ .viminfo MacMini:.vim mediaserver$ ln -s ~/.vim/_vimrc ~/.vimrc MacMini:.vim mediaserver$ ln -s ~/.vim/_gvimrc ~/.gvimrc MacMini:.vim mediaserver$ pwd /Users/mediaserver/.vim MacMini:.vim mediaserver$ git submodule init Submodule 'bundle/tlib_vim' (git://github.com/tomtom/tlib_vim.git) registered for path 'bundle/tlib_vim' Submodule 'bundle/vim-fugitive' (git://github.com/tpope/vim-fugitive.git) registered for path 'bundle/vim-fugitive' Submodule 'bundle/vim-pathogen' (git://github.com/tpope/vim-pathogen.git) registered for path 'bundle/vim-pathogen' Submodule 'bundle/vim-unimpaired' (git://github.com/tpope/vim-unimpaired.git) registered for path 'bundle/vim-unimpaired' MacMini:.vim mediaserver$ git submodule update Cloning into 'bundle/tlib_vim'... remote: Counting objects: 992, done. remote: Compressing objects: 100% (372/372), done. remote: Total 992 (delta 594), reused 946 (delta 549) Receiving objects: 100% (992/992), 210.90 KiB, done. Resolving deltas: 100% (594/594), done. Submodule path 'bundle/tlib_vim': checked out 'd66948917ce7153e4a961aa5d57e1b0918e20495' Cloning into 'bundle/vim-fugitive'... remote: Counting objects: 1481, done. remote: Compressing objects: 100% (525/525), done. remote: Total 1481 (delta 637), reused 1405 (delta 579) Receiving objects: 100% (1481/1481), 190.02 KiB, done. Resolving deltas: 100% (637/637), done. Submodule path 'bundle/vim-fugitive': checked out '1b7e4070f5f7b7522422f5b00a75b323cc314daf' Cloning into 'bundle/vim-pathogen'... remote: Counting objects: 395, done. remote: Compressing objects: 100% (215/215), done. remote: Total 395 (delta 108), reused 372 (delta 90) Receiving objects: 100% (395/395), 47.73 KiB, done. Resolving deltas: 100% (108/108), done. Submodule path 'bundle/vim-pathogen': checked out 'ab64b4ddd0c184a528780b498a0b0a5b40248f7c' Cloning into 'bundle/vim-unimpaired'... remote: Counting objects: 260, done. remote: Compressing objects: 100% (118/118), done. remote: Total 260 (delta 84), reused 250 (delta 76) Receiving objects: 100% (260/260), 33.89 KiB, done. Resolving deltas: 100% (84/84), done. Submodule path 'bundle/vim-unimpaired': checked out '440629adb4051e5f9920704570d1ff0e88356dc2' Adding terminal shortcut ‘mvim’ # It is packed in the tbz file. Move it to /usr/bin

Custom build of MacVim with file drawer - pure bliss

·92 words·1 min
OK, NERDTree plugin IS great, but this is awesome. Alloy made custom version of MacVim with file drawer: see https://github.com/alloy/macvim/wiki/Building It is available in source - so you have to compile it yourselves. But if you do not want to, I did it and the binary is attached, built with these features: ./configure –with-feature=huge –enable-rubyinterp –enable-pythoninterp –enable-perlinterp –enable-cscope Archive is attached: MacVim.zip If you want to get my set of plugins and customizations, it is on GitHub: - https://github.com/radegast/dotvim,

Fixing Git plugin for Sublime Text 2

·105 words·1 min
After update, the ST2 started to complain about missing git command. Finding out Git on MBP: platform $ which git git is /usr/bin/git git is /usr/local/bin/git platform $ git --version git version 1.7.7.5 (Apple Git-26) platform $ /usr/bin/git --version git version 1.7.7.5 (Apple Git-26) platform $ /usr/local/bin/git --version git version 1.7.3.2 Fix the the Package file in /Users/miro/Library/Application Support/Sublime Text 2/Packages/Git - Git.sublime-settings (it is JSON file)

Gitolite Administration Guide

·470 words·3 mins
How to setup new client # You need to be pensieve admin to do this. You will have to login as service user (non-host account) and su to root. create new Linux user on pensieve setup gitolite: git clone <git://github.com/sitaramc/gitolite> mkdir bin; export PATH=$PATH:~/bin gitolite/install -ln add own public key to gitolite to get access to gilotile-admin repo (note the naming restrictions!!) gitolite setup -pk miro.pub get public key for the client account admin and add it (there can be multiple admins) clone the gitolite-admin repo from workstation whose pub key was added git clone <client@pensieve.thinkwrap>.[com:gitolite-admin.git](http://comgitolite-admin.git/) add the key to the repo cd gitolite-admin cp ~/mykey.pub keydir vim conf/gitolite conf add the newly added account admit to repos, create new repos if required All gitolite installs are independent so modification in one hosting user have zero impact on others.

Using Gitolite for code sharing setup

·4736 words·23 mins
General setup of code sharing host # The code sharing host (Pensieve) is dedicated Linux server in DMZ, accessible from external locations as well as from internal network (dual homed) - for the build server access. Main features # multiple users each user represent a client: e.g. users client1 Users are separated by Unix permissions: # access rights to /home/USER are 0700 - no access except the dedicated user only ThinkWrap has root access or sudo access the access via ssh for the user is blocked - the user client1 cannot log in using ssh and get shell, only use git to pull or push changes Inside each user, there are multiple projects. # These projects will have multiple repositiories and will follow the naming convention:

GitHub identity mixup

·80 words·1 min
After I created the ThinkWrap GitHub account and uploaded the public key, this key got somehow bound to GitHub identity ‘madamy’ I had to add user madamy to my public GitHub repo - where I keep the dot-files - https://github.com/radegast/dotvim This may be an issue for people that have their own private accounts - the key management is the key. This article is useful: http://sealedabstract.com/code/github-ssh-with-multiple-identities-the-slightly-more-definitive-guide/ http://net.tutsplus.com/tutorials/tools-and-tips/how-to-work-with-github-and-multiple-accounts/ Alternative # Use https for forking , instead read/write ssh. No keys involved there

Few gitbits to remember

·124 words·1 min
Few gitbits to remember # Pushing new local branch to remote repo: # Find a ref that matches experimental in the source repository (most likely, it would findrefs/heads/experimental), and update the same ref (e.g. refs/heads/experimental) in origin repository with it. If experimental did not exist remotely, it would be created.

How to fix the remote origin from read only

·314 words·2 mins
Issue # In dotvim repo, I used readonly URL for cloning the repository. Now I have created local branch ( linux-vm ) to track Linux specific font settings and need them to push up. After creating new SSH pair and adding to GitHub, does not work [tkuser@cplx-dev-vf .vim]$ git status # On branch linux-vm nothing to commit (working directory clean)[tkuser@cplx-dev-vf .vim]$ git push origin linux-vm fatal: remote error: You can't push to git://github.com/radegast/dotvim.git Use git@github.com:radegast/dotvim.git [tkuser@cplx-dev-vf .vim]$ git remote show origin * remote origin Fetch URL: git://github.com/radegast/dotvim.git Push URL: git://github.com/radegast/dotvim.git HEAD branch: master Remote branch: master tracked Local branch configured for 'git pull': master merges with remote master Local ref configured for 'git push': master pushes to master (up to date) [tkuser@cplx-dev-vf .vim]$ git remote set-url --push origin git@github.com:radegast/dotvim.git [tkuser@cplx-dev-vf .vim]$ git remote show origin * remote origin Fetch URL: git://github.com/radegast/dotvim.git Push URL: git@github.com:radegast/dotvim.git HEAD branch: master Remote branch: master tracked Local branch configured for 'git pull': master merges with remote master Local ref configured for 'git push': master pushes to master (up to date) [tkuser@cplx-dev-vf .vim]$ git push origin linux-vm Enter passphrase for key '/home/tkuser/.ssh/id_rsa': Counting objects: 5, done. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 306 bytes, done. Total 3 (delta 1), reused 0 (delta 0) To git@github.com:radegast/dotvim.git * [new branch] linux-vm -> linux-vm The important line is