Git tutorial, getting started with Git

Below is a short comprehensive description of getting Git up and running in just a few minutes. I personally use OSX as a development machine and so the installation part of Git will cover an installation on OSX. If you like to install Git on another platform please take a look at the Git installation documentation. There are a lot of other ways to install Git, but the one described below seems to bring the least hassle on OSX.

Install Git and add your first project

  • First download the installer at the Google Git OSX installer project, http://code.google.com/p/git-osx-installer/downloads/list after running the installer you are good to go.
  • After this easy GUI installation it’s time to startup the terminal, although if you really are into GUI’s you can also download and install OpenInGitGui which can be found at http://code.google.com/p/git-osx-installer/wiki/OpenInGitGui. In your terminal go to the directory where your website is located and initialize a new repository here.

    $cd site_directory
    $git init

    You should now get a response like “Initialized empty Git repository in site_directory/.git/”. The next step is to add the current directory and all of its contents to the repository.

    $git add .
    $git commit -m "Initial import"

    You will now see that all files and directories are committed.

Basically this is it, nothing more to it. You could now start working with Git. Off course we can configure the Git installation just a little bit to set things right.

Basic configuration of Git, ignoring files and configuring the user settings
Whenever you will type “git status” on the current directory you will see if there are any changes that need to be committed, if so you can add them with the “commit” command like we did before. One of the first problems that you will bump into is that your cache files will also be committed. I personally don’t want to commit automatically created cache files or user content. So how can we deal with this? We can create a “.gitignore” file in the root of our project. You can find an example of the .gitignore file below.

*.cache
files

Now any file that has the *.cache extension will be ignored, also all the user content in the files directory will be ignored. This keeps our repository clean. By executing “git show” after committing the .gitignore file you will see that our ignore rules are correctly interpreted.

When you view the Git commit log of the project (“git log”) you will see that Git has already automatically used an author name and email address in the commits we did so far. These values are automatically detected by Git that examined your system configuration. You can change your name and email by executing the following commands:

$git config --global user.name Sjoerd Maessen
$git config --global user.email youremail@address.com

Taking advantage of Git
Off course we didn’t install Git just to add one project and change some basic settings. The power in any version control system is to make checkouts, revert and diff changes. Below you can find some basic commands that you will need to master.

$git checkout thepath
$git diff commitid1 commitid2
$git diff -- filepath
$git revert commitid1

The commands are pretty self explaining like all other commands of Git. If you already worked with other version control systems their is one thing to be aware of, “git revert” doesn’t behave like “svn revert” for example. “Git revert” will do a new commit to reverse a previous one, if you would like to undo your changes you should use “git checkout” instead. The things I have showed above are only small aspects of what Git is capable of. Cloning repo’s, tagging, branching, patching and resolving conflicts are all aspects that will make your life a lot easier, check them out at the Git community book

One more thing
There are some Git GUI repository browsers available that let you view who, why and when something was committed. One that is easy to setup and PHP only is viewgit, give it a try it will just run from your webserver!

http://viewgit.sourceforge.net

Comments

832 responses to “Git tutorial, getting started with Git”

  1. JamesDob Avatar

    sykaaa casino регистрация на сайте Вопрос безопасности всегда стоит на первом месте, когда речь идет об игре на реальные деньги. Sykaaa Casino заявляет об использовании современных технологий шифрования для защиты данных игроков и финансовых транзакций. Лицензия, если таковая имеется (стоит проверить актуальную информацию на сайте), также является показателем того, что казино работает по определенным стандартам и подлежит регулированию. Важно убедиться, что казино имеет действующую лицензию от авторитетного регулятора.

  2. JamesDob Avatar

    sykaaa официальный сайт время Сразу скажу, сайт “Большая Sykaaa Casino” производит впечатление. Дизайн, как правило, стараются сделать ярким и привлекательным, чтобы сразу зацепить игрока. Часто это сочетание темных тонов с яркими акцентами, что создает атмосферу азарта и предвкушения. Иконки игр, баннеры с акциями – все это призвано создать ощущение праздника. Что касается навигации, то здесь тоже стараются сделать максимально удобно. Обычно все основные разделы – “Игры”, “Акции”, “Поддержка”, “Касса” – вынесены на видное место, часто в верхнее меню или боковую панель. Это позволяет быстро найти то, что вам нужно, будь то любимый слот или информация о бонусах. Если вы новичок, то, скорее всего, не запутаетесь.

  3. verde casino auszahlungsdauer Avatar

    Premium-Mitgliedschaften bieten treuen Spielern zudem exklusive Vorteile wie höhere Auszahlungsquoten und spezielle Freispiel-Pakete. Oft gibt’s dann noch Freispiele als besonderes Schmankerl obendrauf. Als eigentliches Willkommensgeschenk gibt’s im Normalfall einen Einzahlungsbonus. Du kannst die besten Online Spielautomaten im einzelnen Spin- oder im Autoplay Modus drehen.
    Alle legalen Online Casinos in Deutschland sind in der amtlichen Whitelist aufgeführt, einer Übersicht aller erlaubten Glücksspielanbieter. Online Casinospiele dürfen also nur mit einer Erlaubnis der jeweiligen Länder angeboten werden, da es sich um besonders risikoanfällige Spielformen handelt. Nur die Länder können Online Casinospiele für ihr Hoheitsgebiet auf gesetzlicher Grundlage Online Casinospiele, also virtuelle Tischspiele wie Roulette, Blackjack, Baccara sind in Deutschland erlaubnisfähig. Während viele Menschen darunter die virtuelle Abbildung von Spielen in Spielhallen verstehen, meint der Gesetzgeber im Glücksspielstaatsvertrag 2021 (GlüStV 2021) damit ausdrücklich virtuelle Tischspiele wie Roulette oder Blackjack.

    References:
    https://online-spielhallen.de/kingmaker-casino-test-spiele-boni-auszahlungen/

  4. https://afrijobs.co.za/ Avatar

    paragon casino marksville la

    References:
    https://dstt.io/mattbethel

  5. HitnSpin Casino Spielgeld Avatar

    Zusätzlich zum 300 € Willkommensbonus erhalten Neuspieler auch noch 100 Freispiele gratis. Dabei aktualisieren wir stets Angaben und Bewertungen der Spielcasinos online, zum Beispiel, wenn ein Anbieter neue Online Casino Spiele ins Programm aufnimmt oder seinen Bonus ändert. Der Willkommensbonus ist eine der attraktivsten Möglichkeiten für neue Spieler, um mit einem erhöhten Guthaben und häufig zusätzlichen Freispielen zu starten. Mobile Casinos bieten Spielern eine bequeme Möglichkeit, Casino Spiele unterwegs zu spielen. Zusätzlich zu den Willkommensboni bieten viele Casinos diverse Aktionen wie Cashback Aktionen, Reload Boni und Gewinnspiele. DundeeSlots ist bekannt für regelmäßige Aktionen mit Freispielen, die Spielern zusätzliche Gewinnchancen bieten.
    Ganz gleich, ob Sie an einem klassischen Spielautomaten die Walzen drehen oder bei einem progressiven Jackpot auf der Jagd nach großen Gewinnen sind, die Spiele von NetEnt bieten Unterhaltung auf höchstem Niveau. Seit seinen Anfängen in der Online-Casino-Branche hat sich NetEnt einen langjährigen Ruf als erstklassiger Spieleanbieter erworben. Hunderte Games warten darauf, von dir entdeckt zu werden, und viele von ihnen ermöglichen Freispiele oder andere spannende Features. 1Red Casino entwickelt sich ständig weiter und bietet ein wettbewerbsfähiges und unterhaltsames Spielerlebnis. Die vielfältige Spielauswahl, die flexiblen Zahlungsoptionen und das Engagement für verantwortungsvolles Spielen machen es zu einem attraktiven Ziel für Spieler weltweit.

    References:
    https://online-spielhallen.de/cosmo-casino-erfahrungen-mitglied-von-casino-rewards/

Leave a Reply

Your email address will not be published. Required fields are marked *