docs/git.howto
2018-03-20 11:40:14 +01:00

180 lines
5.1 KiB
Plaintext

git howto:
basic config stuff:
ger@ger-pc:~$ git config --global user.name "Ger Strikwerda"
ger@ger-pc:~$ git config --global user.email "g.j.c.strikwerda@rug.nl"
ger@ger-pc:~$ git config --global core.editor vi
check config stuff:
ger@ger-pc:~$ git config --list
user.name=Ger Strikwerda
user.email=g.j.c.strikwerda@rug.nl
core.editor=vi
create local dir with files:
ger@ger-pc:~/git$ mkdir rugcms
ger@ger-pc:~/git$ cd rugcms/
ger@ger-pc:~/git/rugcms$ vi firewall.sh
init git:
ger@ger-pc:~/git/rugcms$ git init
Initialized empty Git repository in /home/ger/git/rugcms/.git/
add files:
ger@ger-pc:~/git/rugcms$ git add firewall.sh
commit files:
ger@ger-pc:~/git/rugcms$ git commit -m "eerste commit"
[master (root-commit) 832b3fd] eerste commit
1 file changed, 223 insertions(+)
create mode 100644 firewall.sh
remote git repository:
ger@ger-pc:~/git/rugcms$ git remote add origin https://git.webhosting.rug.nl/p216149/rugcms.git
ger@ger-pc:~/git/rugcms$ git push -u origin master
Username for 'https://git.webhosting.rug.nl': p216149
Password for 'https://p216149@git.webhosting.rug.nl':
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 1.68 KiB | 1.68 MiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://git.webhosting.rug.nl/p216149/rugcms.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
ger@ger-pc:~/git/rugcms$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
new files:
ger@ger-pc:~/git/rugcms$ ls -ltr
total 36
-rw-rw-r-- 1 ger ger 13840 mrt 20 11:04 firewall.sh
-rw-r--r-- 1 ger ger 137 mrt 20 11:11 ifcfg-em1
-rw-r--r-- 1 ger ger 120 mrt 20 11:11 ifcfg-em2
-rw-r--r-- 1 ger ger 202 mrt 20 11:11 ifcfg-bond0
-rw-r--r-- 1 ger ger 141 mrt 20 11:11 ifcfg-br0
-rw-r--r-- 1 ger ger 198 mrt 20 11:11 ifcfg-bond0.934
ger@ger-pc:~/git/rugcms$ git add ./ifcfg-em1
ger@ger-pc:~/git/rugcms$ git add ./ifcfg-em2
ger@ger-pc:~/git/rugcms$ git add ./ifcfg-bond0
ger@ger-pc:~/git/rugcms$ git add ./ifcfg-br0
ger@ger-pc:~/git/rugcms$ git add ./ifcfg-bond0.934
ger@ger-pc:~/git/rugcms$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: ifcfg-bond0
new file: ifcfg-bond0.934
new file: ifcfg-br0
new file: ifcfg-em1
new file: ifcfg-em2
commit new files:
ger@ger-pc:~/git/rugcms$ git commit
[master 3b8aa42] new files:
5 files changed, 48 insertions(+)
create mode 100644 ifcfg-bond0
create mode 100644 ifcfg-bond0.934
create mode 100644 ifcfg-br0
create mode 100644 ifcfg-em1
create mode 100644 ifcfg-em2
git status:
ger@ger-pc:~/git/rugcms$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
push new files to repository:
ger@ger-pc:~/git/rugcms$ git push
Username for 'https://git.webhosting.rug.nl': p216149
Password for 'https://p216149@git.webhosting.rug.nl':
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.07 KiB | 1.07 MiB/s, done.
Total 7 (delta 0), reused 0 (delta 0)
To https://git.webhosting.rug.nl/p216149/rugcms.git
832b3fd..3b8aa42 master -> master
create directory-layout:
ger@ger-pc:~/git/rugcms$ git mv ./firewall.sh ./firewall
ger@ger-pc:~/git/rugcms$ mkdir -p etc/sysconfig/networks-scripts/
ger@ger-pc:~/git/rugcms$ git mv ./ifcfg-* ./etc/sysconfig/networks-scripts/
ger@ger-pc:~/git/rugcms$ git commit
[master 7b0371c] move
6 files changed, 0 insertions(+), 0 deletions(-)
rename ifcfg-bond0 => etc/sysconfig/networks-scripts/ifcfg-bond0 (100%)
rename ifcfg-bond0.934 => etc/sysconfig/networks-scripts/ifcfg-bond0.934 (100%)
rename ifcfg-br0 => etc/sysconfig/networks-scripts/ifcfg-br0 (100%)
rename ifcfg-em1 => etc/sysconfig/networks-scripts/ifcfg-em1 (100%)
rename ifcfg-em2 => etc/sysconfig/networks-scripts/ifcfg-em2 (100%)
rename firewall.sh => firewall/firewall.sh (100%)
ger@ger-pc:~/git/rugcms$ git push
Username for 'https://git.webhosting.rug.nl': p216149
Password for 'https://p216149@git.webhosting.rug.nl':
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 562 bytes | 562.00 KiB/s, done.
Total 6 (delta 0), reused 0 (delta 0)
To https://git.webhosting.rug.nl/p216149/rugcms.git
3b8aa42..7b0371c master -> master
check log:
ger@ger-pc:~/git/rugcms$ git log
commit 7b0371c61b1af6233779aa82bc4136924c7236df (HEAD -> master, origin/master)
Author: Ger Strikwerda <g.j.c.strikwerda@rug.nl>
Date: Tue Mar 20 11:22:07 2018 +0100
move
commit 3b8aa42a87fe8a97ac9afdebbed6805730451fdd
Author: Ger Strikwerda <g.j.c.strikwerda@rug.nl>
Date: Tue Mar 20 11:17:51 2018 +0100
new files:
commit 832b3fd3cdef03d7e8eed6df8948c9d0d886ede6
Author: Ger Strikwerda <g.j.c.strikwerda@rug.nl>
Date: Tue Mar 20 11:04:40 2018 +0100
eerste commit