Welcome to GIT - revisited

Hello,

Git is getting more popular and it's really good. So here is a quick introduction how to get started with it.

First step is to install the tool - you can download it from the official website:
https://git-scm.com/downloads

There are versions for many different OS such as Linux, Windows, Mac OS X and Solaris.

After installing it you should be able to open GIT bash where the fun begins :)

Set your user details such as name and e-mail - this will appear in the commits.
git config --global user.name <your_username>
git config --global user.email <your_email>


It's good to have nice merge tool. There are some supporting 3-way diffs and some usual 2-way diffs. Two of them are worth recommending at this point:


Once you choose your favourite you can set it up for Git using the following command:
git config --global diff.tool <your_diff_tool>

If you want to display the list of config settings use the command:
git config --list

Before you can start working with Git you should also set up your SSH keys. Follow our guide for setting them up:


Most common way of using Git is using the command line via Git Bash tool - and most of the users are OK with it. However there are some users who prefer graphic user interface - so good news is there are GUI tools for Git. Some of them are integrated in the development IDE such as for example Eclipse or NetBeans.
You can also install the dedicated tool such as for example:



That's it basically. Cheers!


How to run bash script on Windows at system startup

Hello,

This topic may be a bit confusing but here is the story.
Let say we have a SH script startApp.sh and we would like to run it on Windows because there is no equivalent BAT script available. In general if you want to run bash script you need some sort of bash command line interpreter. For example you can install Git bash:

Then it's simply - open Git bash and cd to the target script directory and run it manually by invoking the command:
sh startApp.sh
OR
./startApp.sh

Now if you would like to run it without touching the command line you can create a windows shortcut to run the bash script. In the shortcut command you also need to provide a bash program that will execute the script - in this case it will be Git bash. So the shortcut underlying command will be something like this:
"C:\Program Files\Git\bin\sh.exe" C:\tool\bin\startApp.sh

Or if the SH script takes parameter it could look like this:
"C:\Program Files\Git\bin\sh.exe" C:\tool\bin\startApp.sh start

That's pretty cool :) Now if you would like to have it run at windows startup you place this shortcut in the menu start startup folder. On Windows 7 for example it's in the following location:
C:\Users\user.name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Just copy your shortcut there and you are done.

Hope that will help in some cases.