Skip to content
Snippets Groups Projects
Commit ab75680f authored by Nikolai Hartmann's avatar Nikolai Hartmann
Browse files

add instructions for git setup in README

parent f0e341f6
No related branches found
No related tags found
No related merge requests found
......@@ -72,3 +72,51 @@ create with
baseproxy=$HOME/.globus/base.proxy
grid-proxy-init -cert usercert.pem -key userkey.pem -out $baseproxy -valid 10000:00
```
# Setup git directory on server and push changes
```
mkdir git-config
cd git-config
git init
git config receive.denyCurrentBranch updateInstead
```
Then locally add remote and push to server, e.g. (assuming xcache1 is in ssh config)
```
git remote add xcache1 xcache1:git-config
git push xcache1 <branch-name>
```
If the pushed branch is checked out on the server and there are no untracked
changes this will update the files on the server.
On the server, set the worktree to `/`
```
# optionally check out branch, if not default
git checkout <branch-name>
# set worktree to /
git config core.worktree /
# don't track README on the server
git update-index --assume-unchanged /README.md
# clear files, except .git
rm -r *
```
From now on, pushes to the server will update files in-place (if there are no
untracked modifications).
Check status on server, ignoring untracked files
```
git status -uno
```
Optionally one can commit on the server and pull the changes down to the local
repository. But for that one needs to configure a user name and email (can only be one at at time).
```
git config user.name "<user-name>"
git config user.email "<user-email>"
```
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