Git for your life

What is Git ?

Version Control System

Why Using Git ?

Easy collaboration

with team

History in your project

Make some versions

Activity tracking

You can see someone's mistake

Using Git

Install

sudo apt-get install git
Install git bash

Initial Configuration

git init
git config --global user.email 'youremail@yourdomain.com'
git config --global user.name 'your_username'
git clone (your_url)
git remote add (your_remote_origin) (your_url)

Check Status

git status

Add file(s)

git add filename
git add filename1 filenam2
git add .
git add -A

Remove file(s)

git rm --cached filename
git rm filename

Commit

git commit -m "my message"
git commit -Am "my commit message with add file(s)"

Push

Pull

git pull (your_remote_origin) (local_branch)
git push (your_remote_origin) (local_branch)

Check log

git log
git log --oneline

Welcome to the jugle !

Use Case

Designing

  • Initialize
  • Add image
  • Commit
  • Replace with another image
  • Commit
  • Hard reset to first commit

The Better Way

  • Initialize
  • Add image
  • Commit
  • Replace with another image
  • Commit
  • Create another branch
  • Move to the branch
  • Hard reset to first commit

Coding

  • Initialize
  • Add file
  • Commit
  • Edit file
  • Commit

Or do what you want (reset, revert, branch, checkout, stash, etc)

Let's collaborate !

Made with Slides.com