Global Configuration
Author Information
git config --global user.name "mskmoorthy"
git config --global user.email mskmoorthy@gmail.com
Global Configuration
Color Preferences
git config --global color.ui "auto"
Check Configuration
git config --global --list
Create Directory
- Make new directory "exercise01"
- Change into new directory "exercise01"
Create Directory
mkdir exercise01
cd exercise01
Create Local
Git Repository
- Initialize local Repository
Create Local
Git Repository
git init
Edit New File
vim README.md
Edit New File
Vim Commands
i
This is a new file
ESC
:wq
Edit New File
Vim Commands
- i = insert mode
- ...write something...
- ESC = command mode
- :wq = write and quit
What is going on?
git status
Add File to
Repository
git add README.md
What is going on?
git status
Commit File
into Repository
git commit
Write Commit Message
It should look like an email
- First line is the SUBJECT
- Second line is empty
- The rest, are paragraphs with the BODY of the email.
Write Commit Message
Git can already answer
Go to your Github Page
Create a Repository "Exercise01" under your github account (same name)
git remote add origin http://github.com/mskmoorthy/Exercise01.git
git push -u origin
Changes bring
Happiness!
Modify and Commit the file
- Edit the file
- Git add the changes
- Git commit the changes
- Git check the log
Inspect Branches
git branch
Create New Branch
git branch happybranch
git branch
git checkout happybranch
git branch
Move to New Branch
git checkout happybranch
Changes bring
Happiness!
Modify and Commit a file
- Edit the file
- Git add the changes
- Git commit the changes
- Git check the log
File Lifecycle
vim README.md
git add
git commit
git branch
Merge Branch
git branch
git checkout master
git branch
git merge happybranch
Let's do it Again!
git branch happierbranch
git checkout happierbranch
vim README.md
git add README.md
git commit
Merge Differently
git checkout master
git merge --no-ff happierbranch
Branches bring
Happiness!
Branch and Merge
- Create new branch
- Move into new branch
- Edit and commit file
- Move to master branch
- Merge new branch into master
THE END
BY Luis Ibanez some modifications by Moorthy