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
551454fb
Commit
551454fb
authored
6 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
slides of essential commands and branches
parent
f2bc881d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
branches.md
+11
-12
11 additions, 12 deletions
branches.md
essential_commands.md
+8
-4
8 additions, 4 deletions
essential_commands.md
img/branch-create.png
+0
-0
0 additions, 0 deletions
img/branch-create.png
img/branch-i-state.graffle
+0
-0
0 additions, 0 deletions
img/branch-i-state.graffle
with
19 additions
and
16 deletions
branches.md
+
11
−
12
View file @
551454fb
...
...
@@ -69,27 +69,26 @@ $ git checkout develop
## Create your own version
Assume that you want to work on a function for
multiply
ing 2 numbers.
Assume that you want to work on a function for
add
ing 2 numbers.
<div
class=
"fragment"
>
<br>
<font
color=
"red"
>
Create a new
**branch**
!
</font>
```
bash
$
git checkout
-b
multiply-2-numbers
# creates the branch locally
$
git checkout
-b
add-2-numbers
```
The
`-b`
flag creates the branch.
Locally, you have your own version now:
<img
src=
"img/branch-create.png"
class=
"branch-create"
/>
Push the branch to the remote repository
Push your version to your fork:
```
bash
$
git push origin
multiply
-2-numbers
$
git push origin
add
-2-numbers
```
<br>
You can use the 5 essential commands as before.
Only difference: you are on your own branch.
<img
src=
"img/branch-commit.png"
class=
"branch-commit"
/>
<br><br>
(Live Demo)
This diff is collapsed.
Click to expand it.
essential_commands.md
+
8
−
4
View file @
551454fb
...
...
@@ -9,11 +9,11 @@
<br>
or in other words (remember these!):
```
bash
$
git pull
$
git pull
<remote> <branch>
$
git status
$
git add myFile.txt
# example
$
git commit
-m
"myMessage"
# example
$
git push
$
git push
<remote> <branch>
```
...
...
@@ -21,21 +21,25 @@ $ git push
Then, pull the latest revision:
```
bash
$
git pull
$
git pull
origin add-2-numbers
# Already up to date
```
<div
class=
"fragment"
>
<br>
Verify its
`status`
with:
```
bash
$
git status
```
## Modify a file
Modify and rename
`addTwoNumbers.m`
in the folder
`src/firstCommit`
as
`addTwoNumbers_myName`
:
```
bash
$
mv
firstCommit/addTwoNumbers.m firstCommit/addTwoNumbers_myName.m
$
cd
src/firstCommit
$
mv
addTwoNumbers.m addTwoNumbers_myName.m
```
<br>
...
...
This diff is collapsed.
Click to expand it.
img/branch-create.png
+
0
−
0
View replaced file @
f2bc881d
View file @
551454fb
56.2 KiB
|
W:
|
H:
108 KiB
|
W:
|
H:
2-up
Swipe
Onion skin
This diff is collapsed.
Click to expand it.
img/branch-i-state.graffle
+
0
−
0
View file @
551454fb
No preview for this file type
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