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
8437a52b
Commit
8437a52b
authored
8 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
Further changes to slides, essentially branches
parent
e1f2321c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
branches.md
+39
-26
39 additions, 26 deletions
branches.md
forks.md
+2
-26
2 additions, 26 deletions
forks.md
github_gitlab.md
+0
-6
0 additions, 6 deletions
github_gitlab.md
good_practices.md
+12
-3
12 additions, 3 deletions
good_practices.md
installation.md
+2
-4
2 additions, 4 deletions
installation.md
with
55 additions
and
65 deletions
branches.md
+
39
−
26
View file @
8437a52b
## Branches
Expérimentez en toute sécurité
Branch-off within the same repository in order to stay safe!
The master branch:
<img
src=
"img/branch-0-master.png"
class=
"as-is"
/>
## Une branche = Une fonctionnalité
## One branch per feature
Assume that you want to work on a function for a matrix-vector operation.
```
shell
$
git checkout
-b
noel
$
git checkout
-b
matrix_vect_mult_myName
```
The
`-b`
flag creates the branch.
<img
src=
"img/branch-1-checkout-b.png"
class=
"as-is"
/>
##
Navigation
##
Switch between branches
Lister les branches
```
shell
In your terminal, you may see the name of the branch you are on.
List available branches of the repository
```
sh
$
git branch
```
Se positionner dans une branche
```
shell
<div
class=
"fragment"
>
<br>
Checkout another branch
```
sh
$
git checkout <branch_name>
```
```
shell
$
git commit
<div
class=
"fragment"
>
<br>
You can switch back to master with
```
sh
$
git checkout master
```
<img
src=
"img/branch-2-commit.png"
class=
"as-is"
/>
<div
class=
"fragment"
>
<br>
You can use the 5 essential commands as before.
## Fusion
### En anglais, _merge_
Only difference: you are on your own branch.
```
shell
$
git checkout master
$
git diff master..noel
$
git merge noel
```
<img
src=
"img/branch-3-merge.png"
class=
"as-is"
/>
## Merge a branch
If you want your feature on the
`develop`
or
`master`
branches, merge your branch with the
`develop`
or
`master`
or branch:
## Nettoyage
<br>
**submit a MR or a PR**
via the Github/Gitlab interface.
<!-- PICTURES HERE //-->
```
shell
$
git branch
-d
noel
<div
class=
"fragment"
>
<br>
**ADVANCED**
: You can see the differences between branches
```
sh
$
git diff master..matrix_vect_mult_myName
```
<img
src=
"img/branch-4-br-d.png"
class=
"as-is"
/>
<br>
You can delete the branch via the interface.
This diff is collapsed.
Click to expand it.
forks.md
+
2
−
26
View file @
8437a52b
...
...
@@ -32,30 +32,6 @@ $ git pull origin master # Récupérer le travail
Terminologie de l'application GitHub
##
Avoid conflic
ts
##
Pull/Merge Reques
ts
Good practice:
<large>
**PULL**
</large>
before you
**push**
!
Do
**not**
combine
`git`
commands
```
sh
$
git commit
-am
"myMessage"
# do not do this
```
Verify to have the right remote set on your fork
```
sh
$
git remote
-v
```
Keep your fork up-to-date
```
sh
$
git fetch upstream
$
git merge upstream/master
$
git push origin master
# do not do git push (!)
```
## Pull Requests
How to submit a Pull Request (PR)
How to submit a Pull or Merge Request (PR or MR)
This diff is collapsed.
Click to expand it.
github_gitlab.md
+
0
−
6
View file @
8437a52b
...
...
@@ -11,9 +11,3 @@ Positive point: GitHub and GitLab are (almost) the same.
## GitLab
## Good practices
Always
`clone`
a repository, do not download the
`.zip`
file.
This diff is collapsed.
Click to expand it.
good_practices.md
+
12
−
3
View file @
8437a52b
...
...
@@ -2,9 +2,12 @@
1.
`clone`
a repository, do not download the
`.zip`
file.
2.
`pull`
before
`push`
3.
Work on your own branch (in your own fork)
4.
Do not
`push`
to
`master`
5.
Do not
`push`
to
`develop`
3.
Work on your
**own**
branch (in your own fork)
4.
Do
**not**
`push`
to
`master`
or
`develop`
(submit PR)
5.
Do
**not**
combine
`git`
commands
```
sh
$
git commit
-am
"myMessage"
# do not do this
```
6.
Stage only 1 file at once using
```
sh
$
git add myFile.txt
...
...
@@ -12,6 +15,12 @@ $ git add myFile.txt
7.
Commit only a few files at once
8.
Submit a PR instead of pushing directly
9.
Always sync your fork before starting to work
```
sh
$
git remote
-v
# verify to have the right remote set
$
git fetch upstream
$
git merge upstream/master
$
git push origin master
# do not do git push (!)
```
10.
`Push`
often - avoid conflicts
<br><br>
...
...
This diff is collapsed.
Click to expand it.
installation.md
+
2
−
4
View file @
8437a52b
...
...
@@ -62,9 +62,7 @@ $ git config -l
This should list the configuration with
`user.name`
and
`user.email`
.
## I need to get
<br>
##`The COBRAToolbox` - How?
## I need `The COBRAToolbox` - How?
Simply
`clone`
the repository (i.e., retrieve a copy)
```
sh
...
...
@@ -79,7 +77,7 @@ Any other rudimentary method such as
shall
**be avoided**
!
## How do I
get
any other repository?
## How do I
`clone`
any other repository?
You can clone any other repository with:
```
sh
...
...
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