Skip to content
Snippets Groups Projects
Commit 825be451 authored by Holger Dinkel's avatar Holger Dinkel
Browse files

Merge branch 'master' into THchangesDec2015

parents 468381cc ceab9559
No related branches found
No related tags found
No related merge requests found
Showing
with 283 additions and 141 deletions
......@@ -78,17 +78,13 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/IntroductiontotheLinuxCommandline.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/IntroductiontotheLinuxCommandline.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/IntroductiontotheLinuxCommandline"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/IntroductiontotheLinuxCommandline"
@echo "# devhelp"
epub:
......@@ -115,6 +111,7 @@ latexpdf:
sed -i -e 's/\\usepackage\[utf8\]{inputenc}/\\usepackage[utf8]{inputenc}\\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}/g' $(BUILDDIR)/latex/*.tex
sed -i -e 's|begin{Verbatim}\[|begin{Verbatim}\[frame=single, rulecolor=\\color{lightgray}, fontfamily=courier, |' $(BUILDDIR)/latex/*.tex
sed -i -e 's|\\fancyhead\[LE,RO\]{{\\py@HeaderFamily \\@title, \\py@release}}|\\fancyhead\[LE,RO\]{{\\py@HeaderFamily \\@title}}|' $(BUILDDIR)/latex/sphinx.sty
sed -i -e 's|\\definecolor{VerbatimBorderColor}{rgb}{0,0,0}|\\definecolor{VerbatimBorderColor}{rgb}{1,1,1}|' $(BUILDDIR)/latex/sphinx.sty
sed -i -e 's|^\\release.*||' $(BUILDDIR)/latex/*.tex
echo 'delim_0 "\\\dotfill"' >> $(BUILDDIR)/latex/python.ist
echo 'delim_1 "\\\dotfill"' >> $(BUILDDIR)/latex/python.ist
......
No preview for this file type
git_beginner/_static/git-local.png

67.2 KiB

git_beginner/_static/git-remote.png

105 KiB

git_beginner/_static/repo_distributed.png

68.6 KiB | W: | H:

git_beginner/_static/repo_distributed.png

85 KiB | W: | H:

git_beginner/_static/repo_distributed.png
git_beginner/_static/repo_distributed.png
git_beginner/_static/repo_distributed.png
git_beginner/_static/repo_distributed.png
  • 2-up
  • Swipe
  • Onion skin
git_beginner/_static/repo_single.png

41.5 KiB | W: | H:

git_beginner/_static/repo_single.png

27.7 KiB | W: | H:

git_beginner/_static/repo_single.png
git_beginner/_static/repo_single.png
git_beginner/_static/repo_single.png
git_beginner/_static/repo_single.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -41,8 +41,8 @@ source_encoding = 'utf-8'
master_doc = 'index'
# General information about the project.
project = u'git4beginners'
copyright = u'2013-2014, Holger Dinkel'
project = u'git basics'
copyright = u'2013-2015, Holger Dinkel'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
......@@ -82,9 +82,9 @@ exclude_patterns = ['_build']
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
#pygments_style = 'sphinx'
pygments_style = 'sphinx'
#pygments_style = 'colorful'
pygments_style = 'lsi.lsiClassStyle'
#pygments_style = 'lsi.lsiClassStyle'
# The default language to highlight source code in. The default is 'python'. The value should be a valid Pygments lexer name, see Showing code examples for more details.
highlight_language = 'console'
......@@ -110,7 +110,7 @@ html_theme = 'nature'
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
html_title = "git4beginners"
html_title = "git basics"
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
......@@ -194,7 +194,7 @@ latex_elements = {
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'gitintro.tex', u'GIT For Beginners',
('index', 'gitintro.tex', u'GIT Basics',
u'Holger Dinkel', 'manual'),
]
......@@ -224,7 +224,7 @@ latex_show_urls = False
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'gitintro', u'GIT For Beginners',
('index', 'gitintro', u'GIT Basics',
[u'Holger Dinkel'], 1)
]
......@@ -238,8 +238,8 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'gitintro', u'GIT For Beginners',
u'Holger Dinkel', 'gitintro', 'GIT For Beginners',
('index', 'gitintro', u'GIT Basics',
u'Holger Dinkel', 'gitintro', 'GIT Basics',
'Miscellaneous'),
]
......
......@@ -8,5 +8,3 @@ An introduction to version control using git
Introduction <introduction>
Links <links>
About Bio-IT <about_bioit>
Acknowlegments <acknowledgments>
The Benefits of Version Control
*******************************
......@@ -22,22 +20,11 @@ The benefits are at hand:
Good VCS systems tag changes with authors who make them.
.. figure:: _static/repo_single.png
:scale: 50 %
Files are `added` from the `working directory`, which always holds the
current version of your files, to the `staging area`. `Staged` files will be stored into the repository in the next `commit`.
The repository itself contains all previous versions of all files ever committed.
.. figure:: _static/repo_distributed.png
Distributed Workflow using a centralized repository. Here, three local copies of one central repository allow you,
Jon and Matt to work on the same files and sync files between each other using the central server.
git at a Glance
***************
===============
git commands
------------
The git tool has many subcommands that can be invoked like `git <subcommand>` for instance `git status` to get the status of a repository.
......@@ -68,12 +55,25 @@ you can read more about each command by invoking the help: ::
git help commit
git concepts
------------
commit
^^^^^^
git Settings
************
A commit is a recorded set of changes in your project's file(s).
Try to group *logical* sets of changes together into one commit -- don't mix changes which are unrelated.
setting your identity
=====================
repository
^^^^^^^^^^
A repository is the history of all your project's commits.
git settings
============
Setting your identity
---------------------
Before we start, we should set the user name and e-mail address.
This is important because every git commit uses this information
......@@ -83,10 +83,12 @@ and it's also incredibly useful when looking at the history and commit log: ::
git config --global user.email johndoe@embl.de
Other useful settings include your favorite editor as well as difftool: ::
Other useful settings include your favorite editor, enabling color output as
well as difftool: ::
git config --global core.editor vim
git config --global merge.tool meld
git config --global core.editor nano
git config --global color.ui auto
git config --global merge.tool kdiff3
......@@ -111,43 +113,88 @@ You can use the `git config --list` command to list all your settings: ::
A Typical git Workflow
**********************
.. figure:: _static/git-local.png
:scale: 85 %
Files are `added` from the `workspace`, which always holds the current
version of your files, to the `staging area`. `Staged` files will be stored
into the local repository in the next `commit`. The repository itself
contains all previous versions of all files ever committed.
(image courtesy of 'research bazaar' https://raw.githubusercontent.com/resbaz/lessons/master/git/git-local.png)
.. figure:: _static/git-remote.png
Distributed workflow using a centralized repository. Here, you use `push`
and `pull` to synchronize your local repository with a remote repository.
(image courtesy of 'research bazaar' https://raw.githubusercontent.com/resbaz/lessons/master/git/git-remote.png)
Creating a git Repository
=========================
Turning an existing directory into a git repository is as simple as changing into that directory and :index:`invoking <init>` `git init`.
Here we first create an empty directory called `new_repository` and create a repository in there: ::
Turning an existing directory into a local git repository is as simple as changing
into that directory and invoking `git init`. However, here we
want to create one repository which we can use from multiple other folders to
sync to/from, therefore in this case, we need to initialize it as a `bare`
repository.
mkdir new_repository
cd new_repository
git init
.. note:: Normally you do not need the `--bare`, but it's essential for this
exercise...
.. note:: As a result, there should be a directory called `.git` in this directory...
So, here we first create an empty directory in our homedirectory called `repos`
(this is meant to hold and serve all our repositories), and create a repository
in there called `mythesis`: ::
mkdir ~/repos
cd ~/repos
mkdir mythesis
cd mythesis
git init --bare
.. note:: As a result, you should have the directory `~/repos/mythesis` and there
should be a directory called `.git` in this directory...
Cloning a git Repository
========================
Instead of creating a new directory, we can :index:`clone` a repository. That `origin` repository can reside in a different folder on our computer, on a
remote machine, or on a dedicated git server:
Local directory: ::
Next, we can `clone` this repository into the `~/Documents/mythesis` folder.::
cd ~/Documents
git clone ../other_directory
git clone ~/repos/mythesis
Remote directory: ::
Initialized empty Git repository in /localhome/training/Desktop/mythesis/.git/
warning: You appear to have cloned an empty repository.
git clone ssh://user@server/project.git
cd mythesis
Remote git server: ::
By `cloning`, we not only get the exact copy as the remote side, but we
automatically tell git where we had got the data from, which allows us later to
sync our changes back...
git clone git@server:user/project
git clone git@git.embl.de:dinkel/linuxcommandline
.. note:: You can clone from either a different folder on our computer, a remote machine (via ssh), or a dedicated git server::
Local directory: ::
git clone ~/repos/mythesis
Remote directory: ::
git clone ssh://remote_user@remote_server/mythesis.git
Remote git server: ::
git clone git@server:user/project
Checking the Status
===================
If you don't know in which state the current repository is in, it's always a good idea to check: ::
If you don't know in which state the current repository is in, it's always a
good idea to check: ::
git status
......@@ -157,13 +204,18 @@ If you don't know in which state the current repository is in, it's always a goo
#
nothing to commit (create/copy files and use "git add" to track)
Here, everything is clear, not much going on (no news is good news).
.. note:: In fact, it's good practice, to use `git status` as often as
possible!
Adding files
=============
First, we'll create a new file: ::
echo "First entry in first file!" > file1.txt
echo "My first line towards a great paper!" > paper.txt
git status
......@@ -174,12 +226,14 @@ First, we'll create a new file: ::
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# file1.txt
# paper.txt
nothing added to commit but untracked files present (use "git add" to track)
Now we'll add this file to the so called `staging area`: ::
Here, git tells us that there is a file, however it's `untracked`, meaning git
does not know/care about it. We need to tell git first that it should keep track
of it. So we'll add this file to the so called `staging area`: ::
git add file1.txt
git add paper.txt
git status
......@@ -190,10 +244,11 @@ Now we'll add this file to the so called `staging area`: ::
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: file1.txt
# new file: paper.txt
#
This tells us that the `file1.txt` has been added and can be committed to the repository.
This tells us that the `paper.txt` has been added and can be committed to the
repository.
Committing changes
......@@ -231,10 +286,21 @@ Name & Email-address of the committer, Date & Time of the commit as well as the
message describing the changes you made
Exercise
--------
Repeat the add/commit procedures you just learned. Add more files, use an editor
to add more content to the `paper.txt` file, commit your changes providing a
meaningful commit message.
Pushing changes
===============
If we had cloned this repository from a remote location, we probably want our changes to be propagated to that repository as well.
In order to exchange/synchronize your changes with a remote repository, you use `git push`/`git pull`:
.. figure:: _static/git-remote.png
To push all committed changes, simply type: ::
git push
......@@ -242,7 +308,31 @@ To push all committed changes, simply type: ::
.. note:: git "knows" from which location you had cloned this repository and will try to
push to exactly that location (using the protocol you used to clone: ssh, git, etc)...
.. warning:: If you get a warning message, you probably 'just' need to pull others changes before you are allowed to push your own...
.. warning:: If you get a warning message, read it carefully! The most common
error you get when trying to push are changes on the remote end which you first
need to merge into your local repository before you are allowed to push your own...
Creating a second clone
-----------------------
In order to simulate contrubting to our repository from another computer, we will again
checkout the repository, but this time in a different folder named `mythesis-work`::
cd ~/Documents
git clone ~/repos/mythesis mythesis-work
cd ~/Documents/mythesis-work
This repository should contain all the changes you've pushed so far.
Now we want to improve our `paper.txt` document. Use an editor to add more lines
to this file::
echo "This line was contributed from work..." >> paper.txt
Again, `add`, `commit`, and `push` your changes.
Pulling changes
===============
......@@ -255,72 +345,116 @@ In a centralized workflow you actually **must** pull changes that other people h
.. warning:: Ideally, changes from others don't conflict with yours, but whenever someone else has edited the same lines in the same files as you,
you will receive an error message about a **merge conflict**. You will need to resolve this conflict manually, then add each resolved file (`git add`) and commit.
.. echo "And another entry in a second file." > file2.txt
.. git add file2.txt
So we go back to the directory `~/Documents/mythesis` and (after checking the
status) try to get the changes we've done in the `mythesis-work` directory::
Undo local changes
==================
cd ~/Documents/mythesis
One of the great features of using version control is that you can revert (undo) changes easily.
If you want to undo all changes in a local file, you simply checkout the latest version of this file: ::
git status
git checkout -- <filename>
git pull
...
Auto-merging paper.txt
CONFLICT (content): Merge conflict in paper.txt
Automatic merge failed; fix conflicts and then commit the result.
.. warning:: You will loose all changes you made since the last commit!
Solving conflicts
=================
When working collaboratively on a project, it is unavoidable that the same
file gets changed by different contributors. This causes a conflict and needs to
be dealt with.
Using centralized workflow
==========================
.. hint:: It helps minimizing conflicts if you push/pull often!
When you want to use one central repository, to which everybody can push/pull,
you should initialize this repo like so: `git init --bare`.
Basically what this does is create a repository which all the files from the `.git` directory in the working directory.
This also means that you should never add/edit/delete files in this directory. Rather clone this directory in another folder/computer,
edit files there and commit/push (see below)...
To solve a merge conflict, you can either:
EMBL git server
***************
- manually merge the two files (see below)
- discard the remote file: `git checkout --ours conflicted_file.txt`
- discard the local file: `git checkout --theirs conflicted_file.txt`
As part of the Bio-IT initiative, EMBL provides a central git server which can be used as a centralized resource to share and exchange data/code with collaborators:
http://git.embl.de/
Manually merging a conflict
---------------------------
The following rules apply:
To create a conflict, we change the same line in the file `paper.txt` in both
directories (`mythesis` and `mythesis-work`) without pulling each others changes
in between.
Once we pull, git will tell us that a conflict has occurred.::
- Repositories on the EMBL Git server are only granted to EMBL staff members.
- External users can be added as cooperators on a project, but the projects themselves have to be lead by someone with an active EMBL contract.
- Should the project leader leave EMBL, then the project has to be transferred to someone else or the complete repository will be removed.
- Repositories are always installed as sub-repositories of the project leader/repository responsible.
- By default, repositories are installed with only basic access permissions for the repository owner. He/she is then in charge of setting appropriate access permissions as
described on the `Howto <http://git.embl.de/howto.html>`_ page.
Automatic merge failed; fix conflicts and then commit the result.
Basically, to use this server, you need to provide your full name, your EMBL
email address and username, the name and a short description of the
repository/project, along with your SSH public key to the admin and he will set
things up so you are able to access your repository: ::
When git encounters conflicts in files, it adds special markers `<<<<<<<`,
`=======`, `>>>>>>>` into this file wrapping both conflicting changes. It is up
to you to decide which of these changes to keep.::
git clone git@git.embl.de:your_username/your_repository
...
content of the file
...
<<<<<<< HEAD:paper.txt
your home changes
=======
your changes introduced at work
>>>>>>> 000000000000000000000000000000000000:paper.txt
...
rest of the file
...
.. note:: It's important to mention that the username for accessing the git.embl.de server is always **git**, not **your** username!
Make sure to delete the lines that where introduced by git (otherwise you won't
be able to commit changes. If you only wanted to keep your changes than you
would delete everything except your changes::
An SSH key can be generated using the command `ssh-keygen` (Windows users might want to use `putty <http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe>`_) like so: ::
...
content of the file
...
your home changes
...
rest of the file
...
ssh-keygen
Now, you need to add this file again to the staging area and commit to finish
this conflicting merge. Use `git status` to see the status of the repository.
Generating public/private rsa key pair.
Enter file in which to save the key (/home/username/.ssh/id_rsa):
Created directory '/home/username/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/username/.ssh/id_rsa.
Your public key has been saved in /home/username/.ssh/id_rsa.pub.
The key fingerprint is: 2d:14:f5:d8:... username@hostname
This creates two files, in this case `/home/username/.ssh/id_rsa` and
`/home/username/.ssh/id_rsa.pub`. The former is your **private** key and should
**never** be handed out to anybody, while the latter one (ending in `.pub`)
should be distributed to any server on which you intend to use it...
Undo local changes
==================
One of the great features of using version control is that you can revert (undo) changes easily.
If you want to undo all changes in a local file, you simply checkout the latest version of this file: ::
git checkout -- <filename>
.. warning:: You will loose all changes you made since the last commit!
If you want to checkout a specific version (revision) of a file, you need to
specify the hash or name of the revision::
git checkout revision_name <filename>
.. Using centralized workflow
.. ==========================
..
.. When you want to use one central repository, to which everybody can push/pull,
.. you should initialize this repo as *bare* like so: `git init --bare`. Basically
.. what this does is create a repository which all the files from the `.git`
.. directory in the working directory. This also means that you should never
.. add/edit/delete files in this directory. Rather clone this directory in another
.. folder/computer, edit files there and commit/push (see below)...
..
.. github
.. ******
..
.. Github
.. http://www.github.com
..
.. To clone a repository::
..
.. git clone username@github.com:username/repository
......@@ -3,19 +3,16 @@
Links/References
----------------
the git program itself:
the **git** program itself:
- `git for Windows <http://www.git-scm.com/download/win>`_ [#l1]_
- `git for Mac <http://www.git-scm.com/download/mac>`_ [#l2]_
git for `Windows <http://www.git-scm.com/download/win>`_ [#l1]_, or for `Mac <http://www.git-scm.com/download/mac>`_ [#l2]_
Tools:
- `SourceTree (a graphical user interface for git) <http://www.sourcetreeapp.com/download/>`_ [#l3]_
- `DiffMerge (a graphical merge tool) <http://www.sourcegear.com/diffmerge/>`_ [#l4]_
- `Kdiff3 (another graphical merge tool) <http://kdiff3.sourceforge.net/>`_ [#l5]_
- `githug - a game to learn git <https://github.com/gazler/githug>`_ [#l6]_
References:
......@@ -30,7 +27,7 @@ References:
Scientific Articles About Git:
- `Git can facilitate greater reproducibility and increased transparency in science <http://www.ncbi.nlm.nih.gov/pubmed/23448176>`_ [#l12]_
- `Git can facilitate greater reproducibility & increased transparency in science <http://www.ncbi.nlm.nih.gov/pubmed/23448176>`_ [#l12]_
- `Improving the reuse of computational models through version control <http://www.ncbi.nlm.nih.gov/pubmed/23335018>`_ [#l13]_
.. [#l1] `http://www.git-scm.com/download/wi <http://www.git-scm.com/download/wi>`_
......@@ -38,7 +35,7 @@ Scientific Articles About Git:
.. [#l3] `http://www.sourcetreeapp.com/download/ <http://www.sourcetreeapp.com/download/>`_
.. [#l4] `http://www.sourcegear.com/diffmerge/ <http://www.sourcegear.com/diffmerge/>`_
.. [#l5] `http://kdiff3.sourceforge.net/ <http://kdiff3.sourceforge.net/>`_
.. [#l5] `https://github.com/gazler/githug <https://github.com/gazler/githug>`_
.. [#l6] `https://github.com/gazler/githug <https://github.com/gazler/githug>`_
.. [#l7] `http://try.github.io/levels/1/challenges/1 <http://try.github.io/levels/1/challenges/1>`_
.. [#l8] `http://marklodato.github.io/visual-git-guide/index-en.html <http://marklodato.github.io/visual-git-guide/index-en.html>`_
.. [#l9] `http://betterexplained.com/articles/a-visual-guide-to-version-control <http://betterexplained.com/articles/a-visual-guide-to-version-control>`_
......@@ -48,4 +45,4 @@ Scientific Articles About Git:
.. [#l13] `http://www.ncbi.nlm.nih.gov/pubmed/23335018 <http://www.ncbi.nlm.nih.gov/pubmed/23335018>`_
.. figure:: _static/phd101212s.png
:scale: 55 %
:scale: 65 %
......@@ -78,17 +78,13 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/IntroductiontotheLinuxCommandline.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/IntroductiontotheLinuxCommandline.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/IntroductiontotheLinuxCommandline"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/IntroductiontotheLinuxCommandline"
@echo "# devhelp"
epub:
......@@ -114,6 +110,7 @@ latexpdf:
sed -i -e 's/\\usepackage\[utf8\]{inputenc}/\\usepackage[utf8]{inputenc}\\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}/g' $(BUILDDIR)/latex/*.tex
sed -i -e 's|begin{Verbatim}\[|begin{Verbatim}\[frame=single, rulecolor=\\color{lightgray}, fontfamily=courier, |' $(BUILDDIR)/latex/*.tex
sed -i -e 's|\\fancyhead\[LE,RO\]{{\\py@HeaderFamily \\@title, \\py@release}}|\\fancyhead\[LE,RO\]{{\\py@HeaderFamily \\@title}}|' $(BUILDDIR)/latex/sphinx.sty
sed -i -e 's|\\definecolor{VerbatimBorderColor}{rgb}{0,0,0}|\\definecolor{VerbatimBorderColor}{rgb}{1,1,1}|' $(BUILDDIR)/latex/sphinx.sty
sed -i -e 's|^\\release.*||' $(BUILDDIR)/latex/*.tex
echo 'delim_0 "\\\dotfill"' >> $(BUILDDIR)/latex/python.ist
echo 'delim_1 "\\\dotfill"' >> $(BUILDDIR)/latex/python.ist
......
No preview for this file type
......@@ -115,9 +115,9 @@ Since Linux incorporates commands from different sources, options can be availab
******************************
A Journey Through the Commands
******************************
*****************************
A Journey through Commandland
*****************************
Please note that all examples and usage instructions below are just a glimpse of what you can do and reflect our opinion on what's important and what's not. Most of these commands support many more options and different usages. Consult the manpages to find them.
......@@ -505,8 +505,8 @@ To recursively copy files, we need to specify the ``-r`` option. Here, we copy a
**Useful option combinations**:
-av Verbosely copies all source files which are different (different size, different age) or missing from the source. **Beware**: This will also copy files which are older on the source side
-au Silently copies all source files which are different (different size, different age) or missing from the source. This combination will *not* overwrite newer files by older ones
-av Verbosely copies all source files which are different (different size, different age) or missing from the destination **Beware**: This will also copy files which are older on the destination side
-au Silently copies all source files which are different (different size, different age) or missing from the destination This combination will *not* overwrite newer files by older ones
This should not copy any new files, as we previously copied these already:
::
......@@ -758,11 +758,11 @@ Extracting Informations from Files
- Find the term 'Homo sapiens' in the file P04637.txt, but also print two lines before the match: ::
$ grep -A2 'Homo sapiens' P04637.txt
$ grep -B2 'Homo sapiens' P04637.txt
- Find the term 'Homo sapiens' in the file P04637.txt, but also print the three lines following the match: ::
$ grep -B3 'Homo sapiens' P04637.txt
$ grep -A3 'Homo sapiens' P04637.txt
- Find the term 'Homo sapiens' in the file P04637.txt, but also print the surrounding five lines: ::
......
......@@ -49,6 +49,27 @@ Recommended Reading: Real printed paper books
- Siever, E. et al., "*Linux in a Nutshell*", O'Reilly
Running Linux Commands in Mac
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can find the "Terminal" program in the "Utilities" folder of "Applications".
Running Linux Commands in Windows
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Babun
""""""
The easiest way t oget a linux-like console on a Windows host is probably `babun <http://babun.github.io/>`!
Babun features the following:
- Pre-configured Cygwin with a lot of addons
- Command-line installer, no admin rights required
- advanced package manager (like apt-get or yum)
- color console
- Auto update feature
- "Open Babun Here" Explorer context menu entry
Live - CDs
^^^^^^^^^^
......
......@@ -78,17 +78,13 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/LinuxCourse.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/LinuxCourse.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/LinuxCourse"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/LinuxCourse"
@echo "# devhelp"
epub:
......@@ -111,10 +107,12 @@ latex:
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Hacking TeXfile..."
sed -i -e 's/\\usepackage\[utf8\]{inputenc}/\\usepackage[utf8]{inputenc}\\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}/g' $(BUILDDIR)/latex/*.tex
sed -i -e 's/\\usepackage\[utf8\]{inputenc}/\\usepackage[utf8]{inputenc}\\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}\\usepackage{pdfpages}/g' $(BUILDDIR)/latex/*.tex
sed -i -e 's|begin{Verbatim}\[|begin{Verbatim}\[frame=single, rulecolor=\\color{lightgray}, fontfamily=courier, |' $(BUILDDIR)/latex/*.tex
sed -i -e 's|\\fancyhead\[LE,RO\]{{\\py@HeaderFamily \\@title, \\py@release}}|\\fancyhead\[LE,RO\]{{\\py@HeaderFamily \\@title}}|' $(BUILDDIR)/latex/sphinx.sty
sed -i -e 's|\\definecolor{VerbatimBorderColor}{rgb}{0,0,0}|\\definecolor{VerbatimBorderColor}{rgb}{1,1,1}|' $(BUILDDIR)/latex/sphinx.sty
sed -i -e 's|^\\release.*||' $(BUILDDIR)/latex/*.tex
sed -i -e 's|\\end{document}|\\ifthenelse{\\isodd{\\pageref{LastPage}}}{\\null\\clearpage\\thispagestyle{empty}}{}\\includepdf[pages=1]{../../_static/fwunixref.pdf}\\end{document} |' $(BUILDDIR)/latex/*.tex
echo 'delim_0 "\\\dotfill"' >> $(BUILDDIR)/latex/python.ist
echo 'delim_1 "\\\dotfill"' >> $(BUILDDIR)/latex/python.ist
echo 'delim_2 "\\\dotfill"' >> $(BUILDDIR)/latex/python.ist
......
No preview for this file type
......@@ -39,7 +39,7 @@ master_doc = 'index'
# General information about the project.
project = u'Linux Course'
copyright = u'2013,2014, Holger Dinkel, Frank Thommen and Thomas Zichner'
copyright = u'2013,2014, Holger Dinkel, Frank Thommen and Toby Hodges'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
......@@ -192,7 +192,7 @@ latex_elements = {
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'LinuxCourse.tex', u'Linux Course Documentation',
u'Holger Dinkel, Frank Thommen \\& Thomas Zichner', 'manual'),
u'Holger Dinkel, Frank Thommen \\& Toby Hodges', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
......@@ -222,7 +222,7 @@ latex_show_urls = False
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'linuxcourse', u'Linux Course Documentation',
[u'Holger Dinkel, Frank Thommen & Thomas Zichner'], 1)
[u'Holger Dinkel, Frank Thommen & Toby Hodges'], 1)
]
# If true, show URL addresses after external links.
......@@ -236,7 +236,7 @@ man_pages = [
# dir menu entry, description, category)
texinfo_documents = [
('index', 'LinuxCourse', u'Linux Course Documentation',
u'Holger Dinkel, Frank Thommen & Thomas Zichner', 'LinuxCourse', 'One line description of project.',
u'Holger Dinkel, Frank Thommen & Toby Hodges', 'LinuxCourse', 'One line description of project.',
'Miscellaneous'),
]
......
......@@ -17,8 +17,11 @@ EMBL Linux Course
Commandline Tools <commandlinetools>
I/O Redirection <redirection>
Variables <variables>
Exercises Intermediate <exercises_intermediate>
Basic Scripting <basic_scripting>
Solutions <solutions>
Scripting Exercises <scripting_exercises>
Git Intro <git_beginner>
Appendix <appendix>
......
......@@ -78,17 +78,13 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/IntermediateLinuxCourse.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/IntermediateLinuxCourse.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/IntermediateLinuxCourse"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/IntermediateLinuxCourse"
@echo "# devhelp"
epub:
......@@ -115,6 +111,7 @@ latexpdf:
sed -i -e 's/\\usepackage\[utf8\]{inputenc}/\\usepackage[utf8]{inputenc}\\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}\\usepackage{pdfpages}/g' $(BUILDDIR)/latex/*.tex
sed -i -e 's|begin{Verbatim}\[|begin{Verbatim}\[frame=single, rulecolor=\\color{lightgray}, fontfamily=courier, |' $(BUILDDIR)/latex/*.tex
sed -i -e 's|\\fancyhead\[LE,RO\]{{\\py@HeaderFamily \\@title, \\py@release}}|\\fancyhead\[LE,RO\]{{\\py@HeaderFamily \\@title}}|' $(BUILDDIR)/latex/sphinx.sty
sed -i -e 's|\\definecolor{VerbatimBorderColor}{rgb}{0,0,0}|\\definecolor{VerbatimBorderColor}{rgb}{1,1,1}|' $(BUILDDIR)/latex/sphinx.sty
sed -i -e 's|^\\release.*||' $(BUILDDIR)/latex/*.tex
sed -i -e 's|\\end{document}|\\ifthenelse{\\isodd{\\pageref{LastPage}}}{\\null\\clearpage\\thispagestyle{empty}}{}\\includepdf[pages=1]{../../_static/fwunixref.pdf}\\end{document} |' $(BUILDDIR)/latex/*.tex
echo 'delim_0 "\\\dotfill"' >> $(BUILDDIR)/latex/python.ist
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment