Skip to content

[pull] main from ProjectPythia:main #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading