This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
software:git [2010/12/10 03:59] tjhoban |
software:git [2011/03/31 01:46] tjhoban |
||
---|---|---|---|
Line 33: | Line 33: | ||
<code>git diff <filename></code> | <code>git diff <filename></code> | ||
+ | |||
+ | Sometimes (rarely) a repository will get confused. You will see errors like: | ||
+ | |||
+ | <code>error: unable to create temporary sha1 filename .git/objects/95: File exists</code> | ||
+ | |||
+ | This can be corrected by either "chown -R prog .git", or by the commands: | ||
+ | |||
+ | <code> | ||
+ | git fsck | ||
+ | git prune | ||
+ | git repack | ||
+ | git fsck | ||
+ | </code> | ||
+ | |||
+ | ====== Sample Usage ====== | ||
+ | |||
+ | First of all: obtain a copy of the codebase. | ||
+ | <code> | ||
+ | git clone ssh://observer@ops-serv2/home/observer/gits/pcfs_prod.git | ||
+ | </code> | ||
+ | If we already have a repository, we execute a "pull" to ensure our codebase is current before making any changes. | ||
+ | <code> | ||
+ | cd pcfs_prod | ||
+ | git pull origin master | ||
+ | </code> | ||
+ | We wish to modify the template station.prc slightly. | ||
+ | <code> | ||
+ | cd pcfs_prod/AuscopeUtils/proc | ||
+ | vi station.prc | ||
+ | </code> | ||
+ | Having saved our changes, we verify what we have changed, and commit it: | ||
+ | <code> | ||
+ | git diff station.prc | ||
+ | git commit -m "Tweaked the doodad." station.prc | ||
+ | </code> | ||
+ | Now we push our change back up to the primary repository. | ||
+ | <code> | ||
+ | git push origin master. | ||
+ | </code> | ||
+ | The modified station.prc can now be retrieved by executing a "git pull" on any other git repository (ie. in the /usr2/AuScopeUtils directories on the remote pcfs machines). | ||