Read these instruction for a basic understanding of using git with our git.cipherhive.com repository server. You will have a user account created in which you will be allowed to use ssh to upload a folder to the hosting server. Once you have been given a user name follow the instruction below to upload your ssh public key to your user account on the linux based server. Provided you are using Apple, Unix or a Linux based operating system the following commands should work. If you do not run any of the aforementioned systems you may use putty. You may also install linux for free on virtualbox or vmware open source. I would highly recommend ubuntu for a first time user of linux.
Client side (team member workstation at home, run these command in your home directory):
chmod 700 ~/.ssh
cd ~/.ssh
ssh-keygen -t dsa
scp id_dsa.pub git.cipherhive.us:/home/USER/.ssh
“If .ssh file is not already created then just scp to home folder and make the .ssh folder once ssh into server at users home folder.”
Server side(git.cipherhive.us):
mkdir ~/.ssh
chmod 700 ~/.ssh
cat id_dsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
To begin work on your new project one member of the team will need to create the Master git file and upload it to the server.
First enter folder for project:
cd test
Initialize your git project from inside the project folder:
git init
cd .git
nano description (add a quick description of the project).
cd ..
touch git-daemon-export-ok
If you have no files yet i.e. main.cpp, whatever.h, game.txt, then simply create a simple hello.txt text file to identify the first commit to the project. Use an text editor (vim, gedit, notebook) create a txt document and add a simply explanation (Hi this is our help file).
Once your file is created add it to your new project:
git add hello1.txt
or
git add .
the period denotes all files in the folder.
git commit will launch you into a text file documenting your changes add a brief description of files you added or changes you made.
git commit
To save time later for brief additions you may use this command:
git commit -a -m ‘changed some code’
Now lets add the team project to the server for everyone to share (note use your username on the server and your project name, test.git is just an example name):
scp -rp .git/ YourUsername@git.cipherhive.com:/pub/git/test.git
Double check the repository at git.cipherhive.com and make sure all your code was uploaded properly, then either move your folder to a safe place or delete it. You will be using the project folder you clone from the server as shown next. Use one of the following next two commands to perform a clone of your project from the host server.
This command will work without a password once ssh key is given:
git clone ssh://git.cipherhive.com/pub/git/test.git
This command should work once your public key has been transfered:
git clone git://git.cipherhive.us/pub/git/test.git
Throughout the development process it is advisable to use branches for adding new content. The following explains branching and adding new content or editing files.
Once cloned to create a new branch for development:
git branch FooBranch
git branch
git checkout FooBranch
Then add any new files or changes to the new branch by putting them in the folder and using:
git add foo.txt main.cpp
git commit -a
git push origin FooBranch
Once the team has agreed to add your new code you may them merge your code back into the project. Merging your branch will be a matter to decide on with your other development team members.
Merging your branch:
git checkout master
git merge FooBranch
git push
Now the changes will be included in the master project.
To get the latest code in the project at any given time run this command inside of the project folder:
git pull
It is highly advisable you learn more about GIT and the many commands that can be used. Check out the community book here: http://book.git-scm.com/index.html
Take some time to Google errors or questions you may have first before contacting the cipherhive administrators.