Unix / Linux

&
Git and Strategies

- Nishant Shrivastava

nishant@weboniselab.com

github : nishant-shrivastava

twitter  : n1shant

Unix / Linux



Linux

Content


  • Files
  • Directories
  • Paths 
  • Permissions

Files

  //Listing the files under folder (or location) $ ls //Shows you the current Path [Print Working Directories] $ pwd //Creating a file $ touch test_file.txt //Writting into a file : The Shell Way $ echo "I command thee..! Write on to the file." > test_file.txt //Read a file $ cat test_file.txt //Creating a link to the file $ ln test_file.txt wormhole.txt 

Directories

 //Creating a directory $ mkdir officers //Switching on to directories $ cd officers/ $ touch captains.log
$ cd ../ $ mkdir kirk //Creating a Soft Link $ ln -s officers/ kirk/ //Copying the whole directory $ cp -r officers captains //Removing directories $ rm -r officers

PAths



  • Relative Paths
  • Absolute Path
  • Wild cards
  • Copying with Spaces

Permissions


  • Users
  • Users Groups

 - READ - WRITE - EXECUTE

History

  • Setup 

  • Expansion
  • Reverse search
~/.bash_profile //For increasing the size of the lines, written on history export HISTFILESIZE=10000 export HISTSIZE=10000
// For changing the setting to append the history, not rewrite it // whenever you open up a Terminal shopt -s histappend
// To overcome history for multiple shell (for history) export PROMPT_COMMAND='history -a'

DOT FILEs

  • .profile
    • Used for all login shells (zsh , bash , etc)
    • User for environmental stuff.
      • $PATH
      • RUBYLIB
      • $JAVA_HOME
      • etc.

Dot files

  • .bash_profile
    • User only for bash
    • Use for bash-specific stuff.
      • $PS1 prompt
      • bash_completion
      • etc.


Git


is 

GOD


Git 


- Source Code Management System


- It is distributed
- No master copy
- Fast Merges
- Scales up
- Safeguards against corruption

Why git..



- Easy branching and fast
- Work Offline; local commits can be submitted later.
Git commits are atomic and project-wide, not per-file
as in CVS.
Every working tree in Git contains a repository with a
full project history.
No Git repository is inherently more important than
any other.

Let's get our hands dirty...

  • Quick Start :              
 Creating a repository//intialize the git repository$ git init//Adds all the new (uncommited) files to the local repository$ git add . //commit all the files to the local repository (along with a message)$ git commit -m 'Bruce Wayne is not Batman..!!!'

  • Cloning a repository
 $ git clone git@github.com:vparihar01/gitbabu.git 

Creating repository on

 github server..



 $ mkdir BTLV-Webo $ cd BTLV-Webo $ git init $ git commit -m 'Here goes the first commit' $ git remote add origin git@github.com:btlventures/BTLV-Webo.git $ git pull origin master
$ git push -u origin master



Git branching strategy



  • For branching strategy, we use GIT-Flow

Git-Flow




Thank You!

Made with Slides.com