Versioning System - bounswe/bounswe2016group8 GitHub Wiki
The git version control system is a system that allows users to track their projects history and makes the systematization of project versions ,and of changes and comments that made on it, to ease the tracking and comparison process within the whole developing time.
This page will briefly explain how to get started with git.
Why do we use git ?
Listed below are some of the functions we like:
- Git allows developers to work simultaneously.
- Git does not allow overwriting each other’s changes.
- Git maintains a history of every version.
- Git is fast & small & secure.
-Installing Git
You can visit Git's official website to install git. But in this case, we will be using Ubuntu 14.04 for demonstration purposes where we'll install Git using apt-get.
sudo apt-get install git
will download & install git for us.
Initial Configuration
Initially, you need a directory(in your computer) to work with. You can create one using
mkdir /path/to/directory/
then get in there
cd /path/to/directory/
This directory is called parent directory. Now you can download whatever is in this repository to your parent directory with:
git clone https://github.com/bounswe/bounswe2016group8.git
Checking the Status of Your Repository
Simply type
git status
to see what's up in the repository. Edited files will be in color green and the untracked files will be in red. Note that untracked files are the ones that git does not take care of(e.g. send to repository). If you want them to be included in your project you need to tell git to do so.
git add <path to file from parent directory>
Real quick tip: If there are lots and lots of files that you need to add and you are too lazy to type all of their names, you can use
git add .
Which will recursively add everything that's in the parent directory.
Removing Files
Have you added files to Git that you do not want it to track and now you want Git to stop tracking them? Fear not my friend. There are two ways of telling git to stop tracking a file. If you want to keep the file on your local system you'll need
git rm --cached <path to file from parent directory>
If you also want to remove the file from your local system you'll need
git rm <path to file from parent directory>
Committing Changes Once you have staged your files, you can commit them into Git. Imagine a commit as a snapshot in time where you can return back to access your repository at that stage. You associate a commit message with every commit, which you can provide with the -m prefix.
git commit -m 'Some useful message about this commit'
In general, it's a good idea to provide useful commit messages because later on it helps you identify what you changed in that commit. You should avoid anything too vague like 'Fixed some bugs...'
Putting Your Code in the Cloud
Once you have learned how to manage your code on your system, the next step is to put it in the cloud. You can simply do so by:
git push
Conclusion
Git has tons of features and we have only covered the basics here.