How to edit the web pages of the QC group
- Setting up git
Before starting to actually work with git one should set a few defaultsgit config --global user.name "Christof Haettig" git config --global user.email "christof.haettig@rub.de" git config --global rebase.master true git config --global core.excludefiles ~/.gitignore_global
- With the core.excludefiles options you set a file name (here ~/.gitignore_global)
where you can define a number of directories, files, or file types that will be globally ignored by git.
Gobally means here: with all git repositories to which you might work.
It is recommended to specify in this file automatically generated backup files or directories that one typicall never wants to add to git.
For example, put into this file the following lines:
*~ *.swp *.swo .DS_Store
- Setting rebase.master true changes the default behavour of git during the pull of updates from a remote repository. This option will enfore that your local feature branches that you created by branching from the master branch are upated by rebasing them to the current head of the master instead of merging the changes from the master into your feature branch. This will leave to easier understandable histories in the remote repository which is helpful to understand later how the code was changed at which point. (Prevents e.g.\ so-called fox-trott commits.)
- Whenever you commit changes to git it will open an editor to enter a log message. By default git uses for this the editor you defined in your environment variable $VISUAL. If you want to use with git a different editor you can set it with
git config --global core.editory emacs
- With the core.excludefiles options you set a file name (here ~/.gitignore_global)
where you can define a number of directories, files, or file types that will be globally ignored by git.
Gobally means here: with all git repositories to which you might work.
It is recommended to specify in this file automatically generated backup files or directories that one typicall never wants to add to git.
For example, put into this file the following lines:
- Quick changes
Can only be done from a desktop computer within the theochem domain:
- 'cd /home/userwww/userhome/christof.haettig/webpage' to go the internal copy of the web page
- 'git pull' to ensure the internal copy is up-to-date
- then edit the files and check in your browser that the changes are correct
- 'git add file1 file2 ...' where file1, file2, ... is the list of all the files that you changed
- 'git commit' to commit your changes to the local copy of the git repository
- 'git push' to upload the commited changes to /home/turbomole/GITREPOSITORY/webpage.git
- Major changes
Can only be done from any computer with internet connection:
- 'cd' to the directory into which you want to download the source files for the web page
- 'git clone ssh://username@name_of_your_local_machine.theochem.rub.de/home/turbomole/GITREPOSITORY/webpage.git' to download the source files into the subdirectory 'webpage'
- then edit the files and check in your browser that the changes are correct
- 'git add file1 file2 ...' where file1, file2, ... is the list of all the files that you changed
- 'git commit' to commit your changes to the local copy of the git repository
- introduce and commit more changes until your are done
- 'git push' to upload the commited changes to /home/turbomole/GITREPOSITORY/webpage.git
- login to a theochem machine
- 'cd /home/userwww/userhome/christof.haettig/webpage' to go the internal copy of the web page
- 'git pull' to synchronize the internal copy with the central repository
- Revision control with git
The web pages of the quantum chemistry group use git for a revision control of the content. The central repository is located in login:/home/turbomole/GITREPOSITORY/webpage.git. The internal copy of the webpages in /home/userwww/userhome/christof.haettig/webpage is a clone of the central repository.