Changes between Version 14 and Version 15 of u/erica/GitRepos


Ignore:
Timestamp:
05/19/15 14:09:43 (10 years ago)
Author:
Erica Kaminski
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/erica/GitRepos

    v14 v15  
    7676
    7777{{{
    78 git diff filename prev_revision
     78git diff filename HEAD~1 --stats
     79}}}
     80
     81The 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
     83Another way you might go about looking at old files, is to use the command
     84
     85{{{
     86git show commit#(or HEAD~1, etc.):filename > "old.f90"
     87}}}
     88
     89and do a regular diff from the terminal. The commit # is found in
     90
     91{{{
     92git log
    7993}}}
    8094
    8195
    82 Note, as you go on to make changes to this 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).
     96Now, 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).
    8397
    8498To keep track of your changes, you give the command,
     
    95109}}}
    96110
    97 Once you have done this, then you want to merge it with your working branch,
     111Once 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
    98114
    99115{{{
    100 git merge your_new_branch
     116git checkout your_branch
     117git merge development
    101118}}}
    102119
     
    108125
    109126
    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,
     127Once you are done with your edits, you can delete your local copies of the repo with,
    115128
    116129{{{
    117 git delete
     130git branch -d your_branch
    118131}}}
    119132
    120 (although, why is this necessary, can't you just delete your local copies by deleting the whole directory?)
     133However, 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.
    121134
    122 and can delete your branch in the central repo with the command,
     135As a tip, you can always use the command,
     136
     137{{{
     138git help command_name
     139}}}
     140
     141Also as a misc. command, when you are moving files, you should use the command
     142
     143{{{
     144git mv file
     145}}}
     146
     147to track the move.
    123148
    124149
     150
     151