@MMarahatta

manishmarahatta.com.np

me@manishmarahatta.com.np

"programmer, emacs aficionado, linux addict, activist"

GIT/GITHUB

...STUPID content tracker

Version control systems

-manage multiple versions of documents, programs, web sites, etc.

-Valuable for team projects as well as  individual projects

Why version control?

Why version control?(contd..)

-setting track of where we are heading

-easily manage and manipulate huge chunks of data

-optimize or restore to previous version if necessary

Why GIT?

-efficient

-better workflow

Download and Install GIT

http://git-scm.com/downloads

sudo apt-get install git-all
sudo yum install git-all
sudo pacman -S git-all
emerge --ask --verbose dev-vcs/git

Introduce yourself to GIT

git config --global user.name "Mohit Void"
git config --global user.email null@void.com

Initialization

-Open a Terminal/Prompt

-Make a new folder inside the Users dir (mkdir test)

-cd into the folder(cd test)

Initialization(contd..)

  • Type "git init" in the terminal/prompt

-This creates a hidden repository(folder) named .git

  • Create a new (.txt) file and input some text
  • Type "git add ."

-The period means "this directory"

-This adds all files/folders to the repository

  • Type git commit –m "VOID commit"

-Comment the task you completed

 

Clone a repository from elsewhere

  • Type "git clone URL" or "git clone URL mypath"

-This make an exact copy of the repository

  • eg: git clone git://github.com/voidestperson/file.git

 

The repository

  • The directory contains everything about your project
  • Any new changes "COMMIT it"

 

init and the .git repository

  • When "git init" was executed, you created a repository
  • Subdirectory named .git contains every files to make a normal folder into a repository
  • The dot indicates a “hidden” directory
  • You don't want to mess with that directory

Making commits

  • Until you commit the changes, the changes are not saved
  • Committing makes a “snapshot” of everything being tracked into your repository

-git commit –m “bug fixed”/ git commit

  • Commit must contain summary of latest development

Working with others

  • Type "git pull remote_repository"

-Get updates from a remote repository and merge them into your own repository

  • Type "git status"

-Track your changes(use it often)

  • Remember to add new files using "git add ."
  • Type "git commit –m “What did you contribute?”
  • git push -u origin master

Working with others(GUI)

TASK

-Create a text file and contribute your 'name', 'phone no', 'semester' and 'email' into my repository

Questions???

Thank You

CHEERS

Made with Slides.com