Skip to content

advanced git commands

Sri Harsha Boda edited this page Sep 15, 2017 · 1 revision
  • Compare two branches and list changed files

From command line compare two branches and list changed files

                 git diff --name-status develop..branchName  
  • Pushing changes to new branch and reverting back

     1.Create new branch in your local  
    
                   git checkout -b <new_branch_name> 
    
     2.Add the changed files one by one  and commit else commit everything using third command  
    
                   git add <file_name>
                   git commit -m "<message>"
    
                   git commit -am "<message>"  
           
     3.Push your new branch to remote     
    
                   git push origin <new_branch_name>   
    
     4.Switch to your earlier working branch   
    
                   git checkout <earlier_working_branch_name>  
    
     5.Revert back to your earlier commit  
    
                   git stash  
    
Clone this wiki locally