GIT usage - Nightinggale/Medieval_Tech GitHub Wiki
How to set up git: https://github.com/Nightinggale/Medieval_Tech/wiki/GIT-start-guide This page assumes you already have a working directory.
This page assumes that you have smartGIT installed (any git client will do). This is not meant to be a replacement for smartGIT documentation. Instead it is meant as a simple subset of options needed to get started. The full documentation can be read here: http://www.syntevo.com/smartgithg/documentation/5/show
When you have your project open in smartGIT, the screen might look a bit confusing at first. Here are the important areas: (left to right, top to bottom)
Directories: self explaining
Files: the files in the location selected in directories. Note that top left of files has file filters.
Changes: This shows the selected file in Files. Left block is the last committed version while the right block is your changes.
Branches: brach selector
I will skip Outgoing and Output. They will show file transfers to/from github and stuff like that.
First I highly recommend changing the file filters. Right now files is full of files with a blue icon. Those files are unknown to git (the media files added manually). Turning off the blue icon in file filters will hide those files.
Selecting which branch to work on:
In branches (default bottom left) you have the following: local branches: This is the branches on your computer, which you are able to write in.
origin: This is the branches on the original server (github)
You can switch to any branch you like by double clicking it. If you click on a non-local branch, it will ask if it should make a local branch of it. Most often this is what you want and you presumably also wants to track the remote branch (meaning you get whatever other people commit).
Making a new commit: Once you think you have reached a milestone worthy of committing, you should do the following:
Select the files one by one and check all changes. If you double click on a file you will get a new window to compare in. It is the same as the Changes part of the main window, except it has more buttons and is bigger.
When you have confirmed that you don't have anything you don't want to commit, then you select all the files you want to commit (in main window) and click commit (Top button row).
You will now see a window with all the files you are going to commit. Check if the list is ok. Below that is a text window with a commit message. This is what the log will tell the commit does to the code. Make a headline of max 50 characters. If that is too little to explain the commit, then make a blank line and after that write what you are committing in more details. The log overview will only show the first 50 characters in the first line, but if you click the commit in question you get the full text. Keep this in mind when writing those messages.
Once files and message are ok, you can commit and the revision you just made is now part of the history (see the log). However it is still only on your computer.
Exchanging data with github
There is an important difference between svn and git. Svn has a server, which the client interacts with quite often as a minimal amount of data is stored locally. Git on the other hand does precisely what its command says when you start: clone. You have a clone of the server data on your HD and you can do more or less everything even in offline mode.
Interaction with the server (github) is limited to sending and receiving commits. There are two important commands for this:
Pull: Download the commits from github you don't have yet.
Push: Upload the commits you have locally, which github lacks.
There is a 3rd button for this called Sync, but technically speaking it is a shortcut to push and pull with one click.
Push is only allowed for people with an account on github and write permission to the project. The project permissions are administrated by Nightinggale.
Pull can easily cause issues if you pull while you have uncommitted changes.
TODO: write something about conflicts (two people changing the same place at the same time)
TODO: write something about log and how to fetch code from old commits.