Getting the source

From UFO:AI

Jump to: navigation, search

Contents

Source

Getting git

Windows

Install msysGit and TortoiseGIT.

Use the msys batch file in the msysGit directory to get the mingw shell and execute all the commands below (if you are not using TortoiseGit and would like to deal with git on the commandline)

Mac OS X

Get git-core through macports

Linux

If you are under Linux git should be installable via your package manager.

Getting the source

The repository includes data_source, all branches and all tags. It's often enough to only check out the master branch - which is the current state of development.

Getting a specific branch

git init ufoai
cd ufoai
git remote add -t master origin git://ufoai.git.sourceforge.net/gitroot/ufoai/ufoai
git fetch
git checkout -t origin/master

to also download data_source

git config --add remote.origin.fetch '+refs/other/*:refs/remotes/origin/*'

Getting the whole repository

Check out the repository with:

git clone git://ufoai.git.sourceforge.net/gitroot/ufoai/ufoai

to download the source. This is a read-only checkout. To get the repository with write support, type:

git clone ssh://USER@ufoai.git.sourceforge.net/gitroot/ufoai/ufoai (write access)

both commands will create a directory named ufoai.

Config

For non-global options you have to cd into your git checkout directory first.

git config --global user.name "Your Name"
git config --global user.email mail@example.com
git config --global alias.upbase "rebase '@{u}'"
git config --global push.default tracking
git config --global core.excludesfile '~/.gitignore'
echo "*~" >> ~/.gitignore

Creating a patch

If you did not commit your changes yet:

git diff > patch.diff

If you commited them already and would like to create a patch from the latest revision:

git format-patch HEAD~

If you would like to make patches for your last three revisions:

git format-patch HEAD~3

Applying patches

git am patch.diff

Show local commits

Shows local commits that are not yet pushed back into the main repository:

git cherry -v

Subsequent uses of the command

git fetch

will update your copy of the source and

git upbase

will merge your changes in. If there are conflicts you have to resolve them and call

git add FILE

to mark the file as resolved. After that the rebase must be continued with:

git rebase --continue
git log

in the same directory presents you a log of recent changes.

git commit

commit changes to your local git repository

git push

pushes your commits to the global git repository.

git checkout .

reverts your local/uncommited changes.

Getting help

Shows all available git commands:

git help --all

Next steps

Webclient

There is also a GIT Webclient to browse the repository with your webbrowser.

External Links

Git config

[alias]
abort = rebase --abort
amend = commit --amend
ann = annotate
ada = add -A
adu = add -u
bvv = branch -vv
cat = cat-file -p
ci = commit -a
co = checkout
conflict = !$EDITOR -c '/^[<=|>]\\{7\\}\\( \\|$\\)' `git ls-files --unmerged | cut -c 51- | uniq`
contains = branch -a --contains
continue = !git adu && git rebase --continue
cox = checkout-index
cx = commit
da = diff HEAD
dci = svn dcommit
di = diff
dx = diff --cached
drop = stash drop
gn = grep -In
graph = log --decorate --graph
gw = grep -Inw
less = -p cat-file -p
lg = log --decorate --graph --name-status
lg1 = log --decorate --graph --oneline
list = stash list
pop = stash pop
save = stash save
sf = svn fetch -q
skip = rebase --skip
st = status -s
tar = archive --format=tar
upbase = rebase '@{u}'
updiff = log -p --reverse @{u}..
upstream = branch --set-upstream
[core]
excludesfile = ~/.gitignore
pager = less -x 2 -R
[diff]
renames = copies
[gc]
#auto = 0
[merge]
conflictstyle=diff3
[push]
default=tracking
[user]
email = YOUR_MAIL
name = YOUR_NAME

Links

Personal tools