Changes between Version 6 and Version 7 of Chimera2/git


Ignore:
Timestamp:
May 6, 2013, 1:22:35 PM (13 years ago)
Author:
Conrad Huang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Chimera2/git

    v6 v7  
    256256To /usr/local/projects/chimera2/git/chimera2.git
    257257   a3108a9..fb5b90a  develop -> develop
    258 
    259258</pre>
    260259}}}
    261260
    262261== Stash Modified Files before Switching Branches ==
     262
     263'''git''' provides a very useful feature where one can save the current state of all working files and return to the committed state.  For example, while working some files, a developer may need to update some other files to fix a bug.  The already changed files are not ready to be committed into the repository, but they should not be discarded either.  Using the '''stash''' command, the developer can
     264 - save the current changes,
     265 - return to the committed state,
     266 - make and commit bug fix changes,
     267 - restore the saved changes,
     268 - pull back the bug fix changes, and
     269 - continue development.
     270
     271{{{#!html
     272<pre style="margin-left:20px; margin-right:20px; border:solid 1px; padding:3px; background:white;">
     273<b style="color:#2a2;">[loft - /e/chimera2]$ pwd</b>
     274/e/chimera2
     275<b style="color:#2a2;">[loft - /e/chimera2]$ git status</b>
     276# On branch develop
     277# Changes not staged for commit:
     278#   (use "git add &lt;file&gt;..." to update what will be committed)
     279#   (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
     280#
     281#       modified:   example
     282#
     283no changes added to commit (use "git add" and/or "git commit -a")
     284<b style="color:#2a2;">[loft - /e/chimera2]$ echo "some changes" > example</b>
     285<b style="color:#2a2;">[loft - /e/chimera2]$ git status</b>
     286# On branch develop
     287# Changes not staged for commit:
     288#   (use "git add &lt;file&gt;..." to update what will be committed)
     289#   (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
     290#
     291#       modified:   example
     292#
     293no changes added to commit (use "git add" and/or "git commit -a")
     294<b style="color:#2a2;">[loft - /e/chimera2]$ git stash</b>
     295Saved working directory and index state WIP on develop: fb5b90a Merge branch 'feature/my_new_feature' into develop
     296HEAD is now at fb5b90a Merge branch 'feature/my_new_feature' into develop
     297<b style="color:#2a2;">[loft - /e/chimera2]$ cat example</b>
     298finished product
     299<br/><i><b style="color:#d22;">Here, the developer can make and commit updates without including the earlier changes.</b></i><br/>
     300<b style="color:#2a2;">[loft - /e/chimera2]$ git stash list</b>
     301stash@{0}: WIP on develop: fb5b90a Merge branch 'feature/my_new_feature' into develop
     302<b style="color:#2a2;">[loft - /e/chimera2]$ git stash pop</b>
     303# On branch develop
     304# Changes not staged for commit:
     305#   (use "git add &lt;file&gt;..." to update what will be committed)
     306#   (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
     307#
     308#       modified:   example
     309#
     310no changes added to commit (use "git add" and/or "git commit -a")
     311Dropped refs/stash@{0} (9c7ea9292cd81bd1f4d2606dbab129e3cdd5c0d9)
     312<b style="color:#2a2;">[loft - /e/chimera2]$ cat example</b>
     313some changes
     314<b style="color:#2a2;">[loft - /e/chimera2]$ git pull</b>
     315Already up-to-date.
     316</pre>
     317}}}
    263318
    264319== Use plato Repository to Coordinate Development on Multiple Hosts ==