Changes between Version 14 and Version 15 of u/erica/GitRepos
- Timestamp:
- 05/19/15 14:09:43 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
u/erica/GitRepos
v14 v15 76 76 77 77 {{{ 78 git diff filename prev_revision 78 git diff filename HEAD~1 --stats 79 }}} 80 81 The head~1 is the last committed branch, ~2 is the 2nd to last, etc. Without specifying the pointer (i.e. HEAD), one diffs the uncommitted file with the last committed version by default. Note, that once you commit, you can no longer diff the files by default, and need to specify the pointer. 82 83 Another way you might go about looking at old files, is to use the command 84 85 {{{ 86 git show commit#(or HEAD~1, etc.):filename > "old.f90" 87 }}} 88 89 and do a regular diff from the terminal. The commit # is found in 90 91 {{{ 92 git log 79 93 }}} 80 94 81 95 82 No te, as you go on to make changes to thisbranch, they will be local until you commit and push those changes back into the central repo. (cf. [https://astrobear.pas.rochester.edu/trac/wiki/DevelopmentProcedure here] for details).96 Now, as you go on to make changes to your branch, they will be local until you commit and push those changes back into the central repo. (cf. [https://astrobear.pas.rochester.edu/trac/wiki/DevelopmentProcedure here] for details). 83 97 84 98 To keep track of your changes, you give the command, … … 95 109 }}} 96 110 97 Once you have done this, then you want to merge it with your working branch, 111 Once you have done this, you want to switch back to your working branch so that you can merge the development branch into your working branch, rather than the other way around. This effectively changes the tree structure like so: 112 113 98 114 99 115 {{{ 100 git merge your_new_branch 116 git checkout your_branch 117 git merge development 101 118 }}} 102 119 … … 108 125 109 126 110 ? What about your pushing your ticket branch back into the central repo after it has been merged? Or does command, git push, push *all* of your local repos back into the main repo? 111 112 ?I think you can only push changes back into the central repo that have been 'checked in', right? 113 114 Once you are done with your edits, you can delete your local copies of the repos with, 127 Once you are done with your edits, you can delete your local copies of the repo with, 115 128 116 129 {{{ 117 git delete130 git branch -d your_branch 118 131 }}} 119 132 120 (although, why is this necessary, can't you just delete your local copies by deleting the whole directory?) 133 However, deleting your repo from the central repo is not possible on your own, and you need to ask Jonathan or Baowei to do this for you. Pruning branches should be done with caution. 121 134 122 and can delete your branch in the central repo with the command, 135 As a tip, you can always use the command, 136 137 {{{ 138 git help command_name 139 }}} 140 141 Also as a misc. command, when you are moving files, you should use the command 142 143 {{{ 144 git mv file 145 }}} 146 147 to track the move. 123 148 124 149 150 151