Skip to content

Pulkit-Simform/git_practical

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Commands of GIT for practical

1. Pull and Merge difference

for pull

    git pull

pull screenshot


for merge

    git merge <branch-name>


2. Rebase

    git rebase <branch-name>

3. Change Commit Message

    git rebase -i @~n    # here n stands for to the n commit that we want to change
    # and inside we have to use reword
    # or if we want to change last then we have to use
    git commit --amend

    # here we have used git commit --amend for rewording last commit

Before renaming check de2da56

After renaming check de2da56

4. Cherry Pick

   git cherry-pick <hash-code-of commit>

   e.g. git cherry-pick df88675

Before cherry-pick

After cherry-pick

5. Drop commit

   git rebase -i @~n # n from where to pick

   # and then inside choose the commit name
   # after choosing commit name use "drop" for dropping the commit


   !# and for last change simply used
   git reset HEAD^ # and then commit it

Git log for dropping 98ca8ce

adding drop inside git rebase

Successfully dropped commit 98ca8ce

Git log after dropped

About

Git Practical and submission

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages