Tuesday, 23 January 2018

Git Commands

Git Commands

git log --oneline
git branch
git branch feature
git branch
git checkout feature
git branch
git checkout -b <new Branch>
git checkout -b extra
git branch
git status

git add .
git commit -m "new login signup files"
git log -oneline
git diff master..feature

git checkout master
git merge feature

To Delete Branch
git branch -d feature
git branch -D feature (Force Delete)


To display contents:
git log --oneline
git show <code>

Change latest commit Name
git commit -amend -m "<<commit messge>>" f1

git commit -am "f2 deleted"

rm f1
git status
git checkout f1  [recover deleted]

git rm filename  [it will be deleted permanetly]
git status
git commit -m "f1 deleted"

git log --oneline

mv f3 f5
git status
git add .
git commit -am "f3 to f5"

git mv f5 f3
git status

git commit -m "f5 rename as f3"
git log --oneline






No comments:

Post a Comment