NCAR / python-tutorial

Online content for self-paced Python tutorial
https://ncar.github.io/python-tutorial/
2 stars 7 forks source link

Step 8 untracked data file isn't listed #18

Closed hCraker closed 4 years ago

hCraker commented 4 years ago

In step 8, I’m supposed to see the downloaded file listed as untracked, but I only see ./ listed. I think this is because the directory we are in was made a few steps prior and is also untracked so it's masking the untracked file it contains. I think it would be best to either add data as a tracked directory or add an explanation that we only want the data file to be tracked and that the data file might not be listed by git status.

For context, I'm using the Miniconda3 terminal on Windows.

jukent commented 4 years ago

@kmpaul What are your thoughts on this?

kmpaul commented 4 years ago

@hCraker What is the exact output you get from git status?

jukent commented 4 years ago

@hCraker Do you have a gitignore set up? I don't think we should yet, but this is the only thing I can think of.

hCraker commented 4 years ago
(base) C:\Users\hcraker\Documents\python_tutorial\data>git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        ./

nothing added to commit but untracked files present (use "git add" to track)
hCraker commented 4 years ago

@hCraker Do you have a gitignore set up? I don't think we should yet, but this is the only thing I can think of.

I don't believe I do. The output of git status --ignored is the same as above.

kmpaul commented 4 years ago

Ah! I think we missed a step (?) that said:

cd ..

before

git status
kmpaul commented 4 years ago

Also, double check (after cd ..) that there is a file in the data directory.

ls data/

mnlevy1981 commented 4 years ago

I just followed the steps on a mac and am seeing the same as @hCraker

$ ls
wxobs20170821.txt
$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    ./

moving up a directory shows that data is not tracked:

$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    data/

This is git 2.23.0, for what it's worth

kmpaul commented 4 years ago

Interesting. I will try on my end tomorrow, too. And amend the text to match.

hCraker commented 4 years ago

Also, double check (after cd ..) that there is a file in the data directory.

ls data/

Here are the results of what you suggested. It seems that the directory you're in when using git status doesn't matter. We may have to leave a note in the tutorial that says the file won't show up as untracked due to the directory also being untracked. Then again, I don't know enough about git to think of a quick and easy work around.

(base) C:\Users\hcraker\Documents\python_tutorial>git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        data/

nothing added to commit but untracked files present (use "git add" to track)
(base) C:\Users\hcraker\Documents\python_tutorial>ls data
wxobs20170821.txt
kmpaul commented 4 years ago

Well, I've reproduced the results you all have received on my machine. I'll amend the text to match the actual behavior.