-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitlab.intro.txt
152 lines (120 loc) · 4.02 KB
/
gitlab.intro.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
Part 1
sudo apt update && sudo apt install -y git python3 python3-venv
alternative:
Anaconda 2020.02 for Linux Installer...
Git setup:
git config --global user.name "Sandra Eldrum"
git config --global user.email "[email protected]"
or check without ""
..
git init
git add bla.py
git commit -m "added bla.py"
git log
git status
python3 pymath.py
changing bla.py...
git commit -m "changed bla.py
git log
git checkout bff03a..
or
git checkout master
git diff
later
git config core.hooksPath .githooks
git diff HEAD~1
HEAD~2
...
git branch -av
git branch -a
git push
git pull
git branch log (creating a new branch)
edit file.py
git add --update
git commit -m "add log function"
git push -u origin log (this is now pushed to the new branch or the project)
-u is shortlink for --set-upstream origin master
showing branches in shell>
git log --graph
git commit -a (add all files in repo that have been changed but not new files!) -m "adding all"
git remote add origin [email protected]:eldrum/bla.git
or set url correct>
git remote set-url origin [email protected]:fortner/pymath-example.git
git push origin master (push local master to origin and there also call it master)
or/and
git push origin master
if you havn't set up a ssh key, (https://gitlab.physik.uni-kiel.de/profile/keys) use this:
git remote add origin https://...
once your project is on gitlab, invite members of the group to your project..
permission...
cloning a project to work on...
upper right has a clone button..
type
git clone [email protected]:forstner/pymath-example.py
[it's here..]
git pull (alles, wenn es nur ein file ist)
git fetch (newest changes from commit)
git diff HEAD~1
alles gleich..
modify pymath-example.py..
git status
git add --update (add all changed files)
your shell will tell you what happened..:]
git config user.email "[email protected]"
git commit -m "added useful fkt"
git fetch (if there isn't anything new and your new .py is useful, you can now push into the masterbranch)
git push
or
git push -u origin master
Part 2
...
git branch multiplication
git checkout multiplication
git status
git log
What i did:
git clone [email protected]:forstner/pymath-example.git
git remote add origin [email protected]:/forstner/pymath-example
git push origin master
git add *
git status
git fetch to add new files
git pull
or
git pull origin master to fully update, fetch, and merge
.gitignore....is a file that you can put into your filesystem (where .git lies), and you just write into it (list) everything, that does not change and does not need to be added via
git add
Goto Pymath-Project, Settings..
Runners
Enable shared Runners...(pc-deamon to watch for shared scripts..) runner is now waiting
GOTO Shell>
git add .gitlab-ci.yml
git commit -m 'set up CI'
git push
GOT Browser-gitlab>
clock icon, job has passed...triggered 47 sec. ago..
editing .gitlab-ci.ym to add new pymath.py to get announcements..create documentation...distributions..all sorts of things are automatically created via this helperscript running on some 'deamon'/virtual machine which is part of the gitlab-project-physics-environment (somewhere inside the IT of Uni Kiel/Physics Group!
git commit..
link>
https://gitlab.physik.uni-kiel.de/forstner/pymath-example/pipelines/8423
UNIFIED CODESTYLE>
open source editor by Microsoft(?!) will autmatically check correct formatting (SolO-formatting):
vscodium
pycharm
Commit-hooks>
.yml or pre-commit hook file, before committing, a script is run to check your syntax (locally)
flake8
isort
set up the pre-commit hooks (Gitlab> Project overview-Details)
[pre-commit hooks are like 'compilers' with additional style demands, python is usually pre-compiled unlike C and older languages..]
Decoders..>
Testing..>
write testscript.py to check small codes
Documenting inside code>
For representations it's not necessary, cause they selfrepresent..
#Stuff to the right, i.e. 'TODO', 'FIXME', etc.
or below introduction of new script, classes, and functions/methods
"""Stuff inside,
"""
will end up in the documentation