hello,
I put Sam's instructions about git together and if you are new to git, I hope it can give you some help.
Yan Yang
======================================================================================
Preparation:
0. edit file: /etc/hosts, add one line
1. edit or create file .gnomerc and add one line
export GIT_SSH=/usr/bin/ssh in file
2. generate ssh key pair:
ssh-keygen -t rsa
attention: no passphrase is entered(Enter key should be pressed)
The public key will be saved in .ssh/id_rsa.pub
you should send to Sam the following info:
1). your user name:
2). project names: project name under eclipse: xx_hws
project name for UML: xx_uml
3). git pub key produced by ssh-keygen:
position: .ssh/id_rsa.pub
===============================================================================
0. install git under Ubuntu:
sudo apt-get install git-core
1. push files to the remote server:
mkdir xx_uml
cd xx_uml
git init
touch test.txt
git add .
git commit -a -m "Initial import"
git remote add origin git...@bbtcollege.com:xx_uml.git
(Attention: keep login name gitosis unchanged, it is not your user name)
git push origin master
2. clone project to your pc from remove server:
delete the xx_uml dir at your pc
git clone git...@bbtcollege.com:xx.git
3. update project from remote server
git pull git...@bbtcollege.com:xx.git master
Now the passage between your pc and remote server is built
======================================================================
1. install git plugin for eclipse
1) eclipse memu: Help -> Install new software...
2) Find more software by working with the "Available software Sites" preference
3) search "egit" and select the site then press ok
4) back to install window and select work with
5) select both Eclipse Git Team provider and JGit
6) select all the operations(or just Eclipse EGit & Eclipse Mylyn) then install
Attention: if you meet the following problem during the installation, install mylyn plugin first
"Cannot complete the install because one or more required items could not be found.
Software being installed: EGit Mylyn 1.1.0.201109151100-r (org.eclipse.egit.mylyn.feature.group 1.1.0.201109151100-r)
Missing requirement: EGit Mylyn 1.1.0.201109151100-r (org.eclipse.egit.mylyn.feature.group 1.1.0.201109151100-r) requires 'org.eclipse.mylyn.team_feature.feature.group 3.5.0' but it could not be found"
2. create your own project
3. select "share project" and select "Git" plug-in to share the selected project
4. choose or create a new Repo
5. push your project to remote server:
right click on created project and select Team > Remote > Push...
custom URI:
6. clone repo from remote server:
File > Import > Git > Git Repository
Destination: /home/xx/c++/xx_hws (where to put the project)
done!
tips: for not to write git host every time when you push your project, you can delete your local project and clone it from git remote server folowing the above procesures.
From now on, you can push your project to remote server by
right click on project > team > commit
right click on project > team > push
====================================================================
reference:
git-tutorial.pdf