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
45eb2a4e
Commit
45eb2a4e
authored
8 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
New content of slides (forks)
parent
5e06a51c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!18
merge all
,
!11
new images and content for branches slide
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
slides/forks.md
+61
-18
61 additions, 18 deletions
slides/forks.md
slides/installation.md
+2
-2
2 additions, 2 deletions
slides/installation.md
with
63 additions
and
20 deletions
slides/forks.md
+
61
−
18
View file @
45eb2a4e
## Fork
## Fork
s
<img
src=
"img/remote-0-master.png"
class=
"as-is"
/>
You
**fork**
when you want to work on a public repository or a protected repository.
<img
src=
"img/remote-1-remote.png"
class=
"as-is"
/>
Remember:
## Ajouter une _remote_
-
A
**fork**
is your own
**copy**
of a repository.
-
A
**fork**
can have multiple
**branches**
-
A
**fork**
is not a
**branch**
, but can have multiple
**branches**
.
```
shell
$
git remote add origin git@github.com:<user>/<proj>.git
$
git remote
-v
## Fork on GitLab
## Fork on GitHub
## Clone your fork
Clone first:
```
sh
$
git clone https://git-r3lab.uni.lu/myGroup/myRepo.git forkMyRepo
```
<br>
then, you can change to the directory:
```
sh
$
cd
forkMyRepo
```
```
shell
$
git push origin master
## Add the address of the original repository
Add the
`upstream`
(where you copied from)
```
sh
$
git remote add upstream https://git-r3lab.uni.lu/origGroup/origRepo.git
```
<img
src=
"img/remote-2-push.png"
class=
"as-is"
/>
<br>
You can then check whether the remote address is set correctly:
```
sh
$
git remote
-v
```
<!-- <img src="img/remote-0-master.png" class="as-is" />
//-->
<!-- <img src="img/remote-1-remote.png" class="as-is" />
//-->
<!--- <img src="img/remote-2-push.png" class="as-is" />
//-->
## Récupérer les changements
```
shell
$
git checkout master
# Aller sur la branche master
$
git status
# Est-ce propre? (Bien sûr!)
$
git
pull origin master
# Récupérer le travail
# de l'équipe
## Synchronize your fork
```
sh
$
git
checkout master
$
git status
```
<div class="fragment">
<br>
Fetch the changes from upstream (similar to pull)
```
sh
$
git fetch upstream
```
## _Sync Branch_
Terminologie de l'application GitHub
<div class="fragment">
<br>
Merge the retrieved changes
```
sh
$
git merge upstream/master
```
<div class="fragment">
<br>
Push the changes to your own fork:
```
sh
$
git push origin master
```
## Pull/Merge Requests
...
...
This diff is collapsed.
Click to expand it.
slides/installation.md
+
2
−
2
View file @
45eb2a4e
...
...
@@ -44,7 +44,7 @@ $ git config --global user.email "first.last@uni.lu"
## Does it work?
```
sh
ell
```
sh
$
git
--version
# git version 2.10.0
```
...
...
@@ -77,7 +77,7 @@ Any other rudimentary method such as
shall
**be avoided**
!
## How do I `clone` a
ny other
repository?
## How do I `clone` a 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