path: root/USE.md
blob: 40efd0cd3843b203362c4b2bfc87da94af29fccd (plain)

Using digital source material

Use the source, Luke

-- a pun on Obi-Wan Kenobi quote in Star Wars


Digital source material is tracked with git.

Git is a version control system - a repository for historic versions of file contents of a folder.


To turn a folder into a git repository, go into the folder, and initialize its git database:

git init


To "take a snapshot" of one of more files for git archival, first mark which files are involved and then archive their (changes to) content:

git add foo bar
git add baz
git commit -m "Update foo bar, and add baz."

Alternatively you can update (but not add) in one go:

git commit -m "Update foo bar." foo bar


To collaborate on a shared git repository, first create a local copy from the shared location:

git clone git://{{githost}}/example

Then from time to time syncronize, first fetch eventual updates from others and then push your local changes:

git pull
git push


To publish a git repository initially created locally, first create a new empty git publicly, then tell your local git where its new origin will be, and finally push your local git into its new public location:

ssh {{gitshellhost}} git init --bare --shared /srv/git/{{githost}}/example.git
git remote add origin {{gitshellhost}}:/srv/git/{{githost}}/example.git
git push --set-upstream origin master


  • [source][Source of this document]

[source]: https://source.redpill.dk/source. "Digital source material"