the git-concept:

1. you have a local git repository (/var/www/projectname/.git)

2. via commandline you “hook-up” the local repository with a remote repository (transmission is done via ssh, keys or password)

3. first you commit to local repository, than you do a push to the remote repository…

4. merges are done “in-file” means: git changes your files, inserts all the differences (<—- difference here) and you need to edit it with your favourite IDE.


now how to set this things up?

 

====== SETUP GIT ======

on server:


aptitude update
aptitude upgrade
aptitude install git

mkdir -p /var/git/projectname
cd /var/git/projectname

git --bare init;
git config core.sharedrepository 1;
git config receive.denyNonFastforwards true;
find objects -type d -exec chmod 02770 {} ;

on client:

you can do this via commandline or via eclipse, there is no (major?) difference.

via command line:

mkdir /var/www/projectname
cd /var/www/projectname
git init
git add *
git commit -m "My initial commit message"

or via eclipse:


r-click on projectname -> team -> share -> git

hook @ create repository in parent folde

click on button create repository

in terminal:


git remote add origin ssh://username@yourgitserver.com:SSHPORTNUMBER/var/git/projectname;
git add *;
git commit -m "my initial commit message";
git push -u origin master;

again in eclipse

1. r-click on projectname -> refresh

2. r-click on projectname -> team -> add to index

3. r-click on projectname -> team -> commit (locally)

4. r-click on projectname -> team -> remote -> push (remote)

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin