Help


#1

What is this asking me to do ---------------
Add the changes to the staging area in Git. Recall that you will need to identify the file by its name.


#2

The syntax key reads,

git add <filename>

When we see <filename> we may read it to mean, scene-1.txt, so,

git add scene-1.txt

Notice there are no quotes.


#4

After that, how do you go to the output to notice that changes that have been committed or do step 2?


#5

Hi,

When I did step 1 of exercise 5/9 (git add), I keep getting the following error.

$ git add scene-1.txt
fatal: Not a git repository (or any of the parent directories): .git

I have reported it as a bug but it hasn't been fixed yet. Is this a bug or is there another way to solve the problem?

Thanks.

biz


#6

This doesn't sounds like a bug to me, it sounds you are in the wrong directory, is scene-1.txt in the directory you are currently in? run: ls to see what files are in the current directory, run pwd to see which directory you in, cd directoryname to change directory (replace directoryname with the name of the directory you want to go to), use cd .. to navigate up one directory


#7

I believe I'm in the right directory, sorcerers-code directory and I've done all the checks you mentioned but to no avail. Here's what I've done so far.

$ pwd
/home/ccuser/workspace/sorcerers-code
$ ls
add_test.rb scene-1.txt
$ cd ..
$ git add scene-1.txt
fatal: Not a git repository (or any of the parent directories): .git
$ cd sorcerers-code/
$ git add scene-1.txt
fatal: Not a git repository (or any of the parent directories): .git
$


#8

Can you post the url of the exercise?

It might be you need to initialize a git repository: git init


#9

Ok I will, thanks. Here's the url of the exercise.

https://www.codecademy.com/en/courses/learn-git/lessons/git-workflow/exercises/git-add?action=resume


#10

Do you have a .git directory? You can see this with ls -a


#11

Now it works, after I've initialized a git repository.

$ git init
Initialized empty Git repository in /home/ccuser/workspace/sorcerers-code/.git/
$ git add scene-1.txt
$

I didn't realize I have to initialize a git repository before adding the changes, since that exercise didn't ask us to.

Thanks a lot!


#12

A post was split to a new topic: Need halp with git #2


#13

A post was split to a new topic: How to add filename in git code for six stage?


#14