Skip to content
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

Add in fcm comparison cheat sheet and callouts. #10

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions episodes/01-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ These modern systems also include powerful merging tools that make it possible f
multiple authors to work on
the same files concurrently.

::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::: callout

## Moving to Git from FCM

If you currently use [FCM](https://metomi.github.io/fcm/doc/user_guide/getting_started.html)
(a wrapper around Subversion, SVN) then look out for the following dropdowns.
They contain the FCM equivalent for git commands.

::: spoiler FCM Comparison

Running the `git ...` command is equivalent to:

```bash
fcm ...
```

:::

::::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down
16 changes: 16 additions & 0 deletions episodes/03-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ No commits yet
nothing to commit (create/copy files and use "git add" to track)
```

::: spoiler FCM Comparison

`git status` is equivalent to:

```bash
$ fcm status
```

or

```bash
$ fcm info
```

:::

If you are using a different version of `git`, the exact
wording of the output might be slightly different.

Expand Down
20 changes: 20 additions & 0 deletions episodes/04-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ so that we can write a longer message.
changes made in the commit. Generally, the message should complete the sentence "If applied, this commit will" <commit message here>.
If you want to go into more detail, add a blank line between the summary line and your additional notes. Use this additional space to explain why you made changes and/or what their impact will be.

::: spoiler FCM Comparison

Running `git add` followed by `git commit` is equivalent to:

```bash
$ fcm commit
```

:::

If we run `git status` now:

```bash
Expand Down Expand Up @@ -176,6 +186,16 @@ the commit's author,
when it was created,
and the log message Git was given when the commit was created.

::: spoiler FCM Comparison

`git log` is equivalent to:

```bash
$ fcm log
```

:::

::::::::::::::::::::::::::::::::::::::::: callout

## Where Are My Changes?
Expand Down
11 changes: 11 additions & 0 deletions episodes/05-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ As you might guess from its name,
By default,
it recovers the version of the file recorded in `HEAD`,
which is the last saved commit.

::: spoiler FCM Comparison

`git restore` is equivalent to:

```bash
$ fcm revert FILE
```

:::

If we want to go back even further,
we can use a commit identifier instead, using `-s` option:

Expand Down
131 changes: 131 additions & 0 deletions learners/fcm-git_cheat_sheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
title: FCM vs Git Cheat Sheet
---

## FCM vs Git

If you are familiar with FCM then this cheat sheet is for you!
Adapted from Tomek Trzeciak's comparison page.

### fcm branch-create BRANCH_NAME (fcm bc)

```bash
git checkout -b BRANCH_NAME
```

This also switches you to the new branch.

```bash
git checkout -m -b BRANCH_NAME
```

Switches you to the new branch and also keeps local changes.

### fcm branch-create --switch BRANCH_NAME (fcm bc --switch)

```bash
git checkout -b BRANCH_NAME main
```

### fcm branch-list (fcm bls)

```bash
git branch
```

### fcm checkout BRANCH_URL WORKING_COPY_PATH

```bash
git clone REPO_URL WORKING_COPY_PATH
cd WORKING_COPY_PATH
git checkout BRANCH_NAME
```

### fcm switch BRANCH_NAME

```bash
git checkout BRANCH_NAME
```

or the newer command:

```bash
git switch BRANCH_NAME
```

### fcm status

```bash
git status
```

### fcm info

```bash
git status
```

### fcm log

```bash
git log
```

### fcm merge BRANCH_NAME

```bash
git pull REPO BRANCH_NAME
```

or:

```bash
git fetch REPO
git merge REPO/BRANCH_NAME
```

### fcm conflicts

```bash
git mergetool
```

### fcm resolve --accept=working FILE

```bash
git add FILE
```

### fcm revert FILE

```bash
git checkout -- FILE
```

or the newer command:

```bash
git restore FILE
```

### fcm commit

```bash
git add FILE
git commit
git push
```

### fcm update

```bash
git pull REPO BRANCH_NAME
```

If `BRANCH_NAME` is not specified the default branch will be pulled.

### fcm branch-delete BRANCH_NAME (fcm brm BRANCH_NAME)

```bash
git branch -d BRANCH_NAME
```
Loading