Archive for the ‘GIT’ Category

January 19, 2016 0

keep a checked out version of master updated via hook on a remote server – The JACK hook

By in GIT

A small hook meant to be installed on a remote git repo. The hook is a post update hook and sould be run by the remote repo each time somebody successfully pushes to the repo. It will create a directory called master and check out the remote repo into this and make sure to pull […]

Tags: , ,

May 6, 2015 0

running a bash script from windows command using bash installed by git for windows

By in GIT, Windows

from a windows command navigated to git bin folder one can execute: bash.exe –login -i to start a nice shell if this line is given another parameter its assumed to be a script file which is executed. Additional arguments are passed to the script file as arguments. bash.exe –login -i “myscript.sh” “arguments”

Tags: ,

March 13, 2015 0

setting up git mergetool on windows

By in GIT, Windows

One possible merge tool for windows is kdiff3 which works great. after installing kdiff3 git needs to be set up. This blog post describes it (http://www.blog.project13.pl/index.php/coding/1192/setup-git-on-windows-to-use-kdiff3-as-its-mergetool/) but its repeated here: add the following to .gitconfig [merge] tool=kdiff3 [mergetool “kdiff3”] path = C:/Program Files/KDiff3/kdiff3.exe keepBackup = false trustExitCode = false

Tags: , ,

May 27, 2013 0

push all submodules in a git repo

By in GIT

If you have a git repository that consist of several submodules you can push all submodules by doing the following: place yourself in the main git repo. write: git submodule foreach git push To make sure that you get through all the submodules even if errors occurs do: git submodule foreach “git push || true”

Tags: , ,

February 8, 2013 0

git revert only one file that has not been committed

By in GIT

You have made changes to a file that you realize was wrong (eg. overrige a file’s content) and you want to revert it to the latest comitted version: git checkout <filename> If you have a branch with the same name you need to do: git checkout — <filename> source: http://norbauer.com/notebooks/code/notes/git-revert-reset-a-single-file

Tags: , , ,

September 13, 2012 0

merging when git conflict – setup and tools

By in GIT

Possible merge tools: kdiff3 and meld Setup kdiff3 in git git config –global difftool.prompt false git config –global difftool.kdiff3.trustExitCode false git config –global diff.tool kdiff3 git config –global mergetool.kdiff3.trustExitCode false git config –global mergetool.keepBackup false git config –global merge.tool kdiff3 When forming a merge command the following variables can be used (This should however not […]

Tags: , , , , , ,

February 21, 2012 0

Git: adding and removing branches from remote repositories

By in GIT

You can add a branch to a remote repository by git push origin <branchname> and you can remove this branch again by typing git push origin :<branchname> so prepending a :

February 21, 2012 0

Git Correct commit pushed to remote repository

By in GIT

If you have pushed something to a remote repository that should not have been pushed then do the following: checkout locally the commit that you want to replace the erroneous commit (this should be a commit at an earlier stage than the unwanted one) git push -f origin master this will force the remote repository to be […]

February 21, 2012 0

rebase in GIT

By in GIT

git rebase is a great way to clean up the history adding a -i like git rebase -i enters interactive mode and directs you to a file that let you control what commits are added.

February 10, 2012 0

Git stage lines causes corrupt patch

By in GIT

After making changes you may want to split these changes up into several commits but some of the changes may be in the same file. If you then use git-gui to stage different lines in one file and the last line in this file is part of the diff from HEAD then git-gui will produce […]