Forked from
R3 / school / courses
257 commits behind the upstream repository.
-
Laurent Heirendt authoredLaurent Heirendt authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
essential_commands.md 1.55 KiB
The 5 essential commands
Yes, you only need 5 commands!
pull, status, add, commit, push
or in other words (remember these!):
$ git pull <remote> <branch>
$ git status
$ git add myFile.md # example
$ git commit -m "myMessage" # example
$ git push <remote> <branch>
Pull the latest version of an existing branch
Pull the latest revision on branch myBranch
:
$ git pull origin myBranch
# Already up to date
Verify its status
with:
$ git status
Modify a file
Copy the file firstnameLastname.md
in the folder _attendees
and rename it with your firstname:
$ cd _attendees
$ cp firstnameLastname.md myName.md
Then, make your changes with your favorite editor!
Add your file to the stage
First, check the repository status
$ git status
# uncommitted changes (displayed in red)
Now, add the file (bring it on stage)
$ git add myName.md # replace myName
$ git status
# returns the same as before, generally in green (means staged)
ADVANCED: If there have been more changes after the file has been added, you can see your changes in the terminal
$ git diff
exit with q
Add a commit message
$ git commit -m "Add the profile of <myName>"
$ git status
Push your file to your fork
$ git push origin myBranch
ADVANCED: see the log of all the commits (and your last one) in the terminal
$ git log
exit by typing q
.