An alternative to gitosis: gitolite. I have not tried it yet. But it is perhaps easier to install than gitosis.
Showing posts with label git. Show all posts
Showing posts with label git. Show all posts
Wednesday, 21 April 2010
git trick - shallow cloning
I am reading Oreilly's kurz & gut Git book. And I discovered, that it is possible to clone with a very shallow level by using the "--depth=" option. For example, if you want only to clone the repository with only the three latest commit, you may use:
$mygitworkingdirectory> git clone --depth=3 git:path/repository
Isn't that great. Git rocks !!! ;-)
Saturday, 19 September 2009
Useful Git Tutorial
I found this very useful Git link:
http://www-cs-students.stanford.edu/~blynn/gitmagic/.
I really learnt a lot about it. Another useful link is:
http://progit.org/book/.
Here are a few things I learnt from these links:
- "Snapshots, Not Differences" git does not store differences but new versions of files which changed and links to the unchanged one.
- reordering of commits Using Git, you can commit code to your repository and then reorganize the order of your commits. This makes it much more simpler to group changes in a meaningful way.
- branching is easy
Monday, 1 September 2008
GIT tutorial
I was having a look at the git tutorial.
The important tasks:
1/ download the code of the linux kernel from git:
>git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
2/ pulling new code from git:> git pull
3/ reverse code changes> git checkout -f
4/ commiting the modifications:> git commit -a
5/ undo last commits (note it is different from a revert which consists of a patch reverting some other patch)> git reset HEAD~2
6/ list branches> git branch
7/ create branch> git checkout -b my-new-branch-name master
8/ choose a branch and make it the current one:> git checkout branch
9/ Tell which branch is current> git status
10/ merging code into a branch mybranch> git checkout mybranch
> git merge anotherbranch
Labels:
git,
kernel programming
Thursday, 10 January 2008
GIT
The original developer of Linux has built another versioning system in order to help his linux kernel maintenance job. This tool is git.
The Karlsruher Linux User Group has a presentation summing up the features of this distributed versioning system which I am going to use.
Git repositories seem also to be smaller in size than their equivalent repositories under CVS or SVN.
The presentation gives an example for gcc, which is 450 MB with git while 11GB using SVN.
One of the important feature is that this system is distributed.
Only few commands are needed, and help is available:
> git command -h gives a short help while
> git command --help gives a manual page
Initialisation is performed using the following commands:
> git config --global user.name "Your Name"
> git config --global user.email your@e.mail
Initalisation of a new repository is performed using:
> git init
in the location of the repository (i.e. > cd intherepositorydirectory beforehand)
To clone an existing repository: > git clone giturl [dir]
where giturl is the url of the repository (with http, git, ssh, user@host:repository, dir are acceptable as protocols). See git clone --help for the possibilities. Optimisations are even possibles using hardlinks and softlinks or reuse existing informations.
To prepare commits, useful commands: status and diff. I don't need to explain why they are here for.
To add elements to the repository, the add command is necessary which also adds directories recursively.
changes are added with git-add.
Commits are performed using the command:
> git commit -m ’message’
Of course, it is possible to tell which files should be commited. This is done by using -- filenames at the end of the commandline.
Also take a look at git commit -a -m ’message’.
There is also a menu controlled used. for this use:
> git commit --interactive -m ’message’
To check the code out, use:
> git checkout [-m] -b newbranch [head]
you can also list the branches, using git branch, or change branch: > git checkout branch
or delete branches: git branch -d name.
There is also the possibility to add remote repositories using:
> git remote add name giturl
where name is the name of the remote repository and giturl the url of the remote repository.
you can fetch the changes using:
> git fetch [name] [refspec]
where name is the name of the remote repository and refspec is the mapping: +srcbranch:dstbranch
you can merge changes using > git pull [name] [refspec]
There is also > git merge but its use is infrequent.
Other features are the publication of changes using mails or using the git server.
There are also commands for the maintenance:
> git fsck makes concistency checks on the repository
and
> git gc compresses the repository.
Some other features exist like: signed tags, find bugs semi automatically, ...
Labels:
git,
SCM,
Versioning
Subscribe to:
Comments (Atom)