This repo has been prepared as the platform to practice git commands.
It is perfectly ok to break things.
-
cloneUse this command to clone an existing repo. To clone this repo,
git clone https://github.com/CADWRDeltaModeling/test.gitTo change the name of the directory (e.g., "github_exercises"),
git clone https://github.com/CADWRDeltaModeling/test.git github_exercises -
initUse this to create a new git repo. For example, running
git initwill make the current directory a git repo. -
statusThis shows the status of the local repo - any changes, what have been staged, etc.
Frequently used options:
-s-u[mode]: Specifies what is displayed under "Untracked files".-umust be followed by one of the following modes without any space (e.g.,git status -uno):no: Hides untracked files.all: Shows all untracked files. Same as runninggit status -u.normal: Shows untracked files and the names of directories that contain untracked files (without the contents therein). Same as runninggit status(without the-uoption).
Note: git tracks files, not directories. Thus, empty directories will never show up with `git status` -
addThis command stages the changes that have occurred in the local repo (modifying what is inside a file, creating a new file, removing an exsting file, etc. ).
Frequently used options:
-i: Enters interactive mode. Here, user can select deisred commands step by step.-p: Pick and choose different edits and files -
commitCommits currently staged changes.
Frequently used options:
--amend: Whengit commit --amendis run, user can change the last commit message. -
push -
pull -
resetFrequently used options:
--soft--mixed--hard
mvrmrestorestashtag
branchcheckouttrackupdate
- fork
- pull request
- squash
- reorder
- delete