Skip to content

Commit

Permalink
Merge 2208e44 into 2101e01
Browse files Browse the repository at this point in the history
  • Loading branch information
anacmontoya committed May 31, 2024
2 parents 2101e01 + 2208e44 commit 3819515
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions foundations/github/basic-git.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,34 @@ The `git diff` command is a powerful comparison tool (and maybe your second new

- `git status`: see what branch we're on and what state our repo is in.
- `git checkout`: switch between branches (use the `-b` flag to create a new branch and check it out)

```bash
git checkout -b new-branch-name
git checkout <unique-code-of-commit>
git checkout branch-name
```

- `git diff`: compare files between current version and last commit (default), between two commits, or between two branches.

```bash
git diff commit-one commit-two
git diff branch-one..branch-two
```

- `git add`: stage a file for a commit.

```bash
git add file-name
```

- `git commit`: create a new commit with the staged files.

```bash
git commit -m 'message/comment between quotation marks'
```

- `git log`: see the commit history of our branch.
- Press `Q` to exit

### Some other git commands you'll want to know

Expand Down

0 comments on commit 3819515

Please sign in to comment.