Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Git Research

Omer Kirbiyik edited this page Feb 17, 2018 · 2 revisions

Git is a famous version control organization which is founded by Linus Torvalds in 2005. It provides coordination on files that enables several people to work on it. It is commonly used in software but it's not restricted to only code files. Git is free software distributed under the terms of the GNU General Public License version 2.

Main advantages of Git can be summed as from the official web site of Git.

The Git feature that really makes it stand apart from nearly every other SCM out there is its branching model.

Git allows and encourages you to have multiple local branches that can be entirely independent of each other.
The creation, merging, and deletion of those lines of development takes seconds.

This means that you can do things like:

Frictionless Context Switching: Create a branch to try out an idea, commit a few times, switch back to where you
branched from, apply a patch, switch back to where you are experimenting, and merge it in.

Role-Based Codelines: Have a branch that always contains only what goes to production, another that you merge work 
into for testing, and several smaller ones for day to day work.

Feature Based Workflow: Create new branches for each new feature you're working on so you can seamlessly switch 
back and forth between them, then delete each branch when that feature gets merged into your main line.

Disposable Experimentation: Create a branch to experiment in, realize it's not going to work, and just delete it - 
abandoning the work—with nobody else ever seeing it (even if you've pushed other branches in the meantime).

Let's first start with seeing the version of Git.

git --version

It can be configured globally like this

git config --global user.email [email protected]

An empty repository can be initialized with

git init

Files can be add by giving it's path after add command. Let's first add all the files with dot.

git add . 

Status of repository can be retrieved with

git status

Commits can be done easily with commit command(Don't forget to add files before commit)

git commit

Go to particular commit with

git checkout commit_id   

Now we've worked on locally. Let's push our repository to remote.

git remote add origin https://github.com/some_username/cmpe352_project

Push to the remote. Arguments -u origin master are needed for the first time.

git push -u origin master

One of the great feature of Git is branch. We will use branches a lot in our CMPE 352 project. To create one

git branch some_cool_branch_name_here

Checkout on any branch with

git checkout branch_name

If we messed up we will delete the branch like that

git -d branch_name

As we've decided in the Meeting 1 we will follow Git Flow convention in our project. A great blog post can be found in this link..

Main structure of GitFlow is this:

GitFlow

Git is not limited to that of course. We will look from this official documentation when we need additional help.

Resources

Meeting Notes

Team Members

Researches

Templates

Clone this wiki locally