Thursday, 29 November 2012

GIT Commands which we will use most of time


Below are the list of events that we need to follow while doing work on GIT Repository.
  1. ssh sitename.com 
  2. cd publick_html/sitefoldername/  [Sitefoldername represents GIT Repository]
  3. git checkout develop 
  4.  git status 
  5. If in case your branhc is in fast-forwarded mode, execute pull command 
    1.  git pull origin develop 
  6. If in case your branch in Diverged mode, execute rebase instead of pull 
    1.  git rebase origin/develop 
  7. Create a Feature 
    1.  git flow feature start TASK_NUMBER_DESCRIPTION 
    2.  git flow feature publish TASK_NUMBER_DESCRIPTION 
  8. Do all Necessary Files Modifications respective to your work 
  9. Before Commiting any file, better practice to pull any updates are there 
    1. git fetch 
    2. git pull origin feature/ TASK_NUMBER_DESCRIPTION 
    3.  git status
      1. If in case your branhc is in fast-forwarded mode, execute pull command 
        1.  git pull origin feature/ TASK_NUMBER_DESCRIPTION
      2. If in case your branch in Diverged mode, execute rebase instead of pull
        1. git rebase origin/feature/ TASK_NUMBER_DESCRIPTION
  10. git add yourcreatedormodifiedfilenames.extension
  11. git commit -v
    1. Enter your commit message
    2. Press "Ctrl_X" and then "Y" then "Enter"
  12. git status
    1. When we execute this command, if we are able to see the fast-forward / diverged messages we again have to follow the above commands of  "9.3"
  13. git push origin feature/ TASK_NUMBER_DESCRIPTION
 Note:Please do practice all the above commands. if we do like above, we will not get into conflicts.

No comments:

Post a Comment

Thank you so much for providing your valuable feedback. I will will look into them and update my skills & technologies accordingly.