Step 1:- Install git
# yum install git
Step 2:- check the git version
# git --version
Step3:- sign up https://github.com/ or create a free account
Step4:- Add your github email and user name to git
# git config --global user.email pranchaldixit321@gmail.com
# git config --global user.name pranchaldixit
Step5:- Add files and folders to git
Step6:- command
on the terminal go to location of folder/project
# cd /root/Desktop/tools/git/myfolder
# git init
Initialized empty Git repository in /root/Desktop/tools/git/myfolder/.git/
# git status
# ls -al
# git status
# touch test.txt
# git status
# git add test.txt
# git status
# git commit -m "added test.txt"
# git status
# vim test.txt
# touch index.html
# git status
# git add .
# git status
# git commit -m "add index.html, modified test.txt"
# git status
# git remote add origin https://github.com/Pranchaldixit/Repo1.git
# git push -u origin master
# git log
Branching and Merging
===========================
# cd /root/Desktop/tools/git/myfolder
# git branch MyNewBranch
# git checkout MyNewBranch
# touch test2.txt
# git status
# git commit -m "added test2.txt"
# git status
# git commit -m "added test2.txt"
# git add .
# git commit -m "added test2.txt"
# git push -u origin MyNewBranch
# git checkout master
# ls -al
# git merge MyNewBranch
# git push -u origin master
# git branch -d MyNewBranch ===========Delete from local Machine
# git push origin --delete MyNewBranch==Delete from Main repo
========================================================================
# mkdir netauto
# cd netauto/
# ls
# vi s1
# ls
# git init
# la
# git config --global user.name "pranchal dixit"
# git config --global user.email "pranchaldixit123@gmail.com"
# git config --list
# git status
# git add s1
# git status
# git commit -m "add file s1"
# git status
# git log
# cp s1 s2
# vi s2
# vi s1
# git status
# git diff
# vi s1
# git diff
# git add .
# git status
# git diff --staged
# git commit -m "add s2 and edit s1"
# git log
# git log -p
# git rm s2
# git status
# git commit
# git log
# vi s1
# git diff
# git status
# git checkout -- s1
# git diff
# git status
# more s1
# vi s1
# git digg
# git diff
# git add s1
# git diff
# git diff --staged
# git status
# git reset HEAD s1
# git status
# git checkout -- s1
# git status
# git log --s2
# git log -- s2
# git checkout 6280 --s2
# git checkout 6280 -- s2
# ls
# git status
# git commit -m "restore s2"
# touch myapp.pyc
# touch logs/log1.log
# mkdir logs
# touch logs/log1.log
# touch logs/log2.log
# git status
# vi .gitignore
# git status
# git add .
# git commit -m "add .gitignore file"
========================================================================
# mkdir net-auto
# cd net-auto/
# ls
# vi s1
# git init
# git add s1
# git commit -m "create s1"
# cp s1 s2
# git add s2
# git commit -m "create s2"
# git log
# git log --all --decorate --oneline --graph
# alias graph="git log --all --decorate --oneline --graph"
# graph
# git branch SDN
# git branch auth
# git branch
# graph
# git checkout SDN
# graph
# vi s1
# git add s1 ; git commit -m "SDN for s1"
# graph
# cat s1
# git checkout auth
# git branch
# cat s1
# git checkout SDN
# cat s1
# git checkout auth
# vi s1
# git status
# commit -a -m "auth for s1"
# git commit -a -m "auth for s1"
# graph
# git status
# git checkout master
# git diff master..SDN
# git merge SND
# git merge SDN
# cat s1
# graph
# git branch --merged
# git branch -d SDN
# git branch -d auth
# git status
# git merge auth
# graph
# git branch --merged
# git branch -d auth
# git checlout -b dev
# git checkout -b dev
# vi s1
# git diff
# git commit -a -m "update S1 VLANS"
# git checkout master
# vi s1
# git commit a -m "update s1"
# git commit -a -m "update s1"
# graph
# git status
# git merge dev
# git status
# git merge --abort
# graph
# git status
# git merge dev
# git status
# vi s1
# git add s1
# git status
# git commit
# graph
# git branch -d dev
# git log
# git checkout 93ed315
# graph
# git checkout master
# graph
# git checkout 93ed315
# graph
# git branch stage
# graph
# git checkout stage
# graph
# git status
# git checkout master
# vi s1
# git status
# git checkout statge
# git checkout stage
# git stash
# git status
# vi s1
# git stash
# git stash list
# git stash list -p
# git stash apply
# git diff
# git commit -a -m "remove auth"
# git stash list
# git stash apply
# git diff
# git stash list
# git stash save "add yellow vlan"
# git stash list
# git stash save "add yellow vlan"
# git stash list
# yum install git
Step 2:- check the git version
# git --version
Step3:- sign up https://github.com/ or create a free account
Step4:- Add your github email and user name to git
# git config --global user.email pranchaldixit321@gmail.com
# git config --global user.name pranchaldixit
Step5:- Add files and folders to git
Step6:- command
on the terminal go to location of folder/project
# cd /root/Desktop/tools/git/myfolder
# git init
Initialized empty Git repository in /root/Desktop/tools/git/myfolder/.git/
# git status
# ls -al
# git status
# touch test.txt
# git status
# git add test.txt
# git status
# git commit -m "added test.txt"
# git status
# vim test.txt
# touch index.html
# git status
# git add .
# git status
# git commit -m "add index.html, modified test.txt"
# git status
# git remote add origin https://github.com/Pranchaldixit/Repo1.git
# git push -u origin master
# git log
Branching and Merging
===========================
# cd /root/Desktop/tools/git/myfolder
# git branch MyNewBranch
# git checkout MyNewBranch
# touch test2.txt
# git status
# git commit -m "added test2.txt"
# git status
# git commit -m "added test2.txt"
# git add .
# git commit -m "added test2.txt"
# git push -u origin MyNewBranch
# git checkout master
# ls -al
# git merge MyNewBranch
# git push -u origin master
# git branch -d MyNewBranch ===========Delete from local Machine
# git push origin --delete MyNewBranch==Delete from Main repo
========================================================================
# mkdir netauto
# cd netauto/
# ls
# vi s1
# ls
# git init
# la
# git config --global user.name "pranchal dixit"
# git config --global user.email "pranchaldixit123@gmail.com"
# git config --list
# git status
# git add s1
# git status
# git commit -m "add file s1"
# git status
# git log
# cp s1 s2
# vi s2
# vi s1
# git status
# git diff
# vi s1
# git diff
# git add .
# git status
# git diff --staged
# git commit -m "add s2 and edit s1"
# git log
# git log -p
# git rm s2
# git status
# git commit
# git log
# vi s1
# git diff
# git status
# git checkout -- s1
# git diff
# git status
# more s1
# vi s1
# git digg
# git diff
# git add s1
# git diff
# git diff --staged
# git status
# git reset HEAD s1
# git status
# git checkout -- s1
# git status
# git log --s2
# git log -- s2
# git checkout 6280 --s2
# git checkout 6280 -- s2
# ls
# git status
# git commit -m "restore s2"
# touch myapp.pyc
# touch logs/log1.log
# mkdir logs
# touch logs/log1.log
# touch logs/log2.log
# git status
# vi .gitignore
# git status
# git add .
# git commit -m "add .gitignore file"
========================================================================
# mkdir net-auto
# cd net-auto/
# ls
# vi s1
# git init
# git add s1
# git commit -m "create s1"
# cp s1 s2
# git add s2
# git commit -m "create s2"
# git log
# git log --all --decorate --oneline --graph
# alias graph="git log --all --decorate --oneline --graph"
# graph
# git branch SDN
# git branch auth
# git branch
# graph
# git checkout SDN
# graph
# vi s1
# git add s1 ; git commit -m "SDN for s1"
# graph
# cat s1
# git checkout auth
# git branch
# cat s1
# git checkout SDN
# cat s1
# git checkout auth
# vi s1
# git status
# commit -a -m "auth for s1"
# git commit -a -m "auth for s1"
# graph
# git status
# git checkout master
# git diff master..SDN
# git merge SND
# git merge SDN
# cat s1
# graph
# git branch --merged
# git branch -d SDN
# git branch -d auth
# git status
# git merge auth
# graph
# git branch --merged
# git branch -d auth
# git checlout -b dev
# git checkout -b dev
# vi s1
# git diff
# git commit -a -m "update S1 VLANS"
# git checkout master
# vi s1
# git commit a -m "update s1"
# git commit -a -m "update s1"
# graph
# git status
# git merge dev
# git status
# git merge --abort
# graph
# git status
# git merge dev
# git status
# vi s1
# git add s1
# git status
# git commit
# graph
# git branch -d dev
# git log
# git checkout 93ed315
# graph
# git checkout master
# graph
# git checkout 93ed315
# graph
# git branch stage
# graph
# git checkout stage
# graph
# git status
# git checkout master
# vi s1
# git status
# git checkout statge
# git checkout stage
# git stash
# git status
# vi s1
# git stash
# git stash list
# git stash list -p
# git stash apply
# git diff
# git commit -a -m "remove auth"
# git stash list
# git stash apply
# git diff
# git stash list
# git stash save "add yellow vlan"
# git stash list
# git stash save "add yellow vlan"
# git stash list
0 coment�rios:
Note: only a member of this blog may post a comment.