GIT Version Control

I have tried several version control systems including subversion, bzr and git. By far I found GIT to be the easiest to setup and maintain. Also the application is well documented and supported by the original developers. Here I will be sharing my experience with setting up and using GIT for our projects.

Our public repo on Github https://github.com/airtime166

Topic: GIT
In software development, Git is a distributed revision control and source code management (SCM) system with an emphasis on speed.[4] Git was initially designed and developed by Linus Torvalds for Linux kernel development in 2005.

http://wildlyinaccurate.com/a-hackers-guide-to-git/
Server setup:
1. Create a folder on the server. Ex: mkdir /home/user/repo
2. cd into the folder and run git –bare init
The remote git repo need to be set to –bare or else it will be created as a working copy. You will then not be able to push to it remotely. To set this after the fact use git config –bool core.bare true
a. Clone the repo:
b. Use ra slot git clone /home/user/repo
c. cd repo
d. create a test file “touch readme”
e . add some sample content echo “blah” > readme
f . run the following commands
git add .
git commit
git remote add or
git push

git config –global push.default simple
git config –global user.email “you@example.com”
git config –global user.name “Your Name”

To set your account’s default identity.
Omit –global to set the identity only in this repository.
——————

Client setup:

Note: You can change the remote origin by editing the file
.git/config
or use git remote set-url origin git://new.url.here
Example
[remote “origin”]
url = mas@server:path/to/repo

1. create a local folder mkdir /home/testrepo
a. cd /home/testrepo
b. git init
2. run git clone username@serverhost:/home/testrepo
– if you modify a file , issue git commit -a -m “comment”
– if you add a file issue git add .
-before you commit always do a pull — git pull origin master
-then push — git push origin master

Maintaining GIT:
on the server–
-check changes on a branch
git checkout branchname
-merge changes to master
git checkout master
git merge branchname
–** note while you are checkout at the server level. client will not be able to commit

—- add/remove origin
git remote add origin path////
git remote rm origin

–git -V ?

Web configuration information
Gitweb – Openkb Github

ADD A COMMENT