netbox-community / netbox-plugin-tutorial

A tutorial on building custom plugins for NetBox v3.2+
90 stars 48 forks source link

Confused about how to move from step 1 to step 2 #16

Closed ramdyne closed 2 years ago

ramdyne commented 2 years ago

I just started with the tutorial as described in Step 1 and have successfully installed "my" plugin.

Step 2 starts with the following note:

Note: If you skipped the previous step, run git checkout step01-initial-setup.

Step 1 ends with the following tip

Tip: You can check your work at the end of each step in the tutorial by running a git diff against the corresponding branch. For example, at the end of step one, run git diff step01-initial-setup to compare your work with the completed step. This will help identify any tasks you might have missed.

Executing this last command in the location where I ended up after installing the pug, I get

fatal: ambiguous argument 'step01-initial-setup': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Executing the git command from the beginning of step 2 I get

error: The following untracked working tree files would be overwritten by checkout:
    README.md
    netbox_access_lists/__init__.py
    setup.py
Please move or remove them before you switch branches.
Aborting

My git-foo is pretty poor, so I am lost on what to do next. Step 2 suggests that there should have been a git command executed at the end of step 1, but I am sure that a diff is not the one.

What did I miss?

Thanks!

jeremystretch commented 2 years ago

For example, at the end of step one, run git diff step01-initial-setup

This (perhaps incorrectly) assumes you have already checked out the step01-initial-setup branch. If you haven't, instead run:

git diff remotes/origin/step01-initial-setup

It's probably worth updating the tutorial to reference the upstream branch.