Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
courses
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
R3
school
courses
Commits
fcccdcd9
Commit
fcccdcd9
authored
8 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes to slides
parent
f629203b
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
best_practices.md
+5
-6
5 additions, 6 deletions
best_practices.md
branches.md
+25
-4
25 additions, 4 deletions
branches.md
forks.md
+2
-2
2 additions, 2 deletions
forks.md
github_gitlab.md
+4
-0
4 additions, 0 deletions
github_gitlab.md
the_terminal.md
+6
-3
6 additions, 3 deletions
the_terminal.md
with
42 additions
and
15 deletions
best_practices.md
+
5
−
6
View file @
fcccdcd9
...
...
@@ -3,8 +3,8 @@
*
`clone`
a repository, do not download the
`.zip`
file.
*
`pull`
before
`push`
*
Work on your
**own**
branch (in your own fork)
*
Do
**not
**
`
push
`
to
`master`
or
`develop`
(
submit
PR)
*
Get your code reviewed by submit
ted
a PR
*
Do
**not
push
**
to
`master`
or
`develop`
, but
**
submit
a PR**
*
Get your code
**
reviewed
**
by
your peers (
submit a PR
!)
*
Do
**not**
combine
`git`
commands
```
sh
$
git commit
-am
"myMessage"
# do not do this
...
...
@@ -15,9 +15,8 @@ $ git add myFile.txt
```
*
Commit only a few files at once
*
Submit a PR instead of pushing directly
*
Always sync your fork before starting to work
*
Commit
**only a few files**
at once (after multiple separate
`git add`
commands)
*
Always
**sync your fork**
before starting to work
```
sh
$
git remote
-v
# verify to have the right remote set
$
git fetch upstream
...
...
@@ -27,4 +26,4 @@ $ git push origin master # do not do git push (!)
*
`Push`
often - avoid conflicts
<br><br>
**A `push` a day keeps
the
conflict away**
Remember:
**A `push` a day keeps conflict
s
away
!
**
This diff is collapsed.
Click to expand it.
branches.md
+
25
−
4
View file @
fcccdcd9
...
...
@@ -9,13 +9,34 @@ The master branch:
## One branch per feature
Assume that you want to work on a function for a matrix-vector operation.
```
sh
ell
```
sh
$
git checkout
-b
matrix_vect_mult_myName
# creates the branch locally
```
The
`-b`
flag creates the branch.
<img
src=
"img/branch-create.png"
class=
"branch-create"
/>
Push the branch to the remote repository
```
sh
$
git push
```
If you do that,
`git`
will complain
```
sh
fatal: The current branch matrix_vect_mult_myName has no upstream branch.
To push the current branch and
set
the remote as upstream, use
git push
--set-upstream
origin matrix_vect_mult_myName
```
<br>
Follow the advice and do:
```
sh
$
git push
--set-upstream
origin matrix_vect_mult_myName
```
## Switch between branches
...
...
@@ -23,7 +44,7 @@ In your terminal, you may see the name of the branch you are on.
List available branches of the repository
```
sh
$
git branch
$
git branch
--list
```
<div
class=
"fragment"
>
...
...
@@ -35,7 +56,7 @@ $ git checkout <branch_name>
<div
class=
"fragment"
>
<br>
You can switch back to master with
You can switch back to
the
`
master
`
branch
with
```
sh
$
git checkout master
```
...
...
@@ -60,7 +81,7 @@ Use the **interface** to make use of your peers to review your code!
<img
src=
"img/branch-merge.png"
class=
"branch-merge"
/>
<br>
Y
ou can delete the branch via the interface.
Once merged, y
ou can delete the branch via the interface.
## Gitlab interface
...
...
This diff is collapsed.
Click to expand it.
forks.md
+
2
−
2
View file @
fcccdcd9
...
...
@@ -5,7 +5,7 @@ You **fork** when you want to work on a public repository or a protected reposit
Remember:
-
A
**fork**
is your own
**copy**
of a repository.
-
A
**fork**
can have multiple
**branches**
-
A
**fork**
can have multiple
**branches**
.
-
A
**fork**
is not a
**branch**
, but can have multiple
**branches**
.
...
...
@@ -32,7 +32,7 @@ $ cd forkMyRepo
## Add the address of the original repository
Add the
`upstream`
(where you copied from
)
Add the
`upstream`
address (original/protected repository
)
```
sh
$
git remote add upstream https://git-r3lab.uni.lu/origGroup/origRepo.git
```
...
...
This diff is collapsed.
Click to expand it.
github_gitlab.md
+
4
−
0
View file @
fcccdcd9
...
...
@@ -9,8 +9,12 @@ Positive point: GitHub and GitLab are (almost) the same.
## GitHub (Live Demo)
[
www.github.com
](
www.github.com
)
## GitLab (Live Demo)
[
https://git-r3lab.uni.lu
](
https://git-r3lab.uni.lu
)
## Open an issue (Live Demo)
This diff is collapsed.
Click to expand it.
the_terminal.md
+
6
−
3
View file @
fcccdcd9
## The
Linux
Terminal
## The Terminal
(shell)
Starting the terminal presents itself with a line where you can enter a command:
```
sh
...
...
@@ -13,8 +13,8 @@ $
```
<br>
When you open your terminal (
git
shell)
and unless otherwise configured
, you are located
in your home directory, denoted as
`~/`
.
When you open your terminal (shell), you are located
in your home directory
(unless otherwise configured)
, denoted as
`~/`
.
## Essential Linux commands
...
...
@@ -36,7 +36,10 @@ $ cd myDirectory
Change the directory 1 level and 2 levels up
```
sh
$
cd
..
# 1 level up
$
cd
../..
# 2 levels up
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment