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

July 20, 2013

My git cheating sheet

I'll share here my personal git cheating sheet. Commands are accompanied with small description above them. I'll update this once in a while.

January 26, 2013

Git and notepad++ (bookmark)

Hello,

commit messages did not work out of the box in notepad++. It displayed the error "aborting due to empty commit message". I tested it what I have found, however error was shown. This link fixes the issue.

Using Notepad++ for your git commit messages [kitware.com/blog]

January 24, 2013

Github and ssh authentification

I had to set up git for 2 different accounts, but ssh-agent did not allow me to add anything. I found few solutions but none of them was working in my case. Windows 7 runs on my machine. Eventually I found one article which solved my problem, since that ssh-agent is running always when I execute Git bash. Here's the link:

[www.webweavertech.com/ovidiu/weblog]

Update  Januar 24th:

It stopped working, agent was not able to run thus I couldn't fetch anything. The error which was display : bind I was struggling with it again until I tried to change this script:
Re-use existing ssh agent [www.electricmonk.nl]

It executes ssh-agent and automatically add one of my keys when I run git bash:

export SSH_AUTH_SOCK=/tmp/.ssh-socket

ssh-add -l >/dev/null 2>&1
if [ $? = 2 ]; then
   # No ssh-agent running
   rm -rf $SSH_AUTH_SOCK
   ssh-agent -a $SSH_AUTH_SOCK >/tmp/.ssh-script
   source /tmp/.ssh-script
   echo $SSH_AGENT_PID > /tmp/.ssh-agent-pid
   rm /tmp/.ssh-script
 # add key only if ssh agent is not running
  ssh-add c:/Users/xxx/.ssh/ssh_key
fi

January 16, 2013

Git & gitignore

I had to create git ignore files for our project, and it took me more than my expectation. First of all, ** does not work with directories. Second of all, I had an idea to have only one ignore file with plenty of relative paths (not full but using * or ** ) but eventually it failed in my case. Thus I distributed files into subfolders where projects are generated and libraries are built.

This post made it clear and ever since it was simple to exclude specific files in particular directories
Git ignore specific files in directories [stackoverflow.com]

I have something like

!/*/build/iar/
/*/build/iar/*
!/*/build/iar/config files
!/*/build/iar/*.ewp
!/*/build/iar/*.ewd
!/*/build/iar/*.eww


One more tip, I have googled a bit when I faced a problem with git, and usually I landed at git ready webpage. This is excellent git reference.

git ready [gitready.com]