Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
git_tutorial
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
orestis.malaspin
git_tutorial
Commits
36dbad48
Commit
36dbad48
authored
7 years ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
en train de travailler sur le reset
parent
4f37fa08
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
git_tutorial.md
+98
-2
98 additions, 2 deletions
git_tutorial.md
with
98 additions
and
2 deletions
git_tutorial.md
+
98
−
2
View file @
36dbad48
% Introduction à Git
% Orestis Malaspinas
% Version
# Des références
...
...
@@ -194,11 +196,105 @@ Date: Sun Mar 4 22:25:24 2018 +0100
mon premier commit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
# Revenir en arrière dans l'historique (1/
3
)
# Revenir en arrière dans l'historique (1/
5
)
## Commandes: `git checkout`, `git reset`
1.
Faire une modification dans un fichier qu'on aurait pas
dû
faire.
1.
Faire une modification dans un fichier qu'on aurait pas
voulu
faire.
2.
Faire un
`git add`
qu'on aurait pas dû faire.
3.
Faire un
`git commit`
qu'on aurait pas dû faire.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{.bash .numberLines}
[tutorial]$ echo Oh no! An awful modification! > premierfichier.c
[tutorial]$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: premierfichier.c
no changes added to commit (use "git add" and/or "git commit -a")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
# Revenir en arrière dans l'historique (2/5)
## Commandes: `git checkout`, `git reset`
### Une modification dans un fichier qu'on aurait pas voulu faire.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{.bash .numberLines}
[tutorial]$ git checkout premierfichier.c
[tutorial]$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
# Revenir en arrière dans l'historique (3/5)
## Commandes: `git checkout`, `git reset`
### Faire un `git add` qu'on aurait pas dû faire.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{.bash .numberLines}
[tutorial]$ echo Oh no! An awful modification! > premierfichier.c
[tutorial]$ git add premierfichier.c
[tutorial]$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: premierfichier.c
[tutorial]$ git reset HEAD
Unstaged changes after reset:
M premierfichier.c
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
# Revenir en arrière dans l'historique (4/5)
## Commandes: `git checkout`, `git reset`
### Faire un `git add` qu'on aurait pas dû faire.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{.bash .numberLines}
[tutorial]$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: premierfichier.c
no changes added to commit (use "git add" and/or "git commit -a")
[tutorial]$ git diff
diff --git a/premierfichier.c b/premierfichier.c
index 9622e40..cfd5469 100644
--- a/premierfichier.c
+++ b/premierfichier.c
@@ -1 +1 @@
-Wild World
+Oh no! An awful modification!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
# Revenir en arrière dans l'historique (4/5)
## Commandes: `git checkout`, `git reset`
### Faire un `git commit` qu'on aurait pas dû faire.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{.bash .numberLines}
[tutorial]$ git commit -am "troisieme commit"
[master 0563c02] troisieme commit
1 file changed, 1 insertion(+), 1 deletion(-)
[tutorial]$ git reset f9ab3ec4a00c46a12d7a45f133295acc5fb5cd20
[tutorial]$ git checkout premierfichier.c
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
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