6. Git workflow

I have completed the first four instructions in exercise 6, but I’m now stuck on the fifth instruction. I don’t understand what I’m meant to write, or where.

5… Add biology.txt to the staging area.

use git add filename to add files to the staging area

I tried adding git add biology.txt to the right side but it didn’t work.
I just clicked “get code” to try and help me, but now I have to start from the beggining of this task. It won’t let me pass the second instruction as I’ve already made a branch called bio questions, so I don’t know what to do.

your branch name should be bio-questions, i don’t see the hyphen in your branch name, delete the branch:

git branch -d branchname

and create a new one, make sure to spell it correctly

I did add a hyphen, I meant: bio-questions.
I tried to delete it, then add a new one and it came up with this:
$ git branch -d bio-questions fatal: Not a git repository (or any of the parent directories): .git $ $ git branch bio-questions fatal: Not a git repository (or any of the parent directories): .git

you are are either in the wrong working directory, or you forgot to initialize a git repository. There is no git repository, to initialize a git repository use git init

Yes, I’m using a different computer so thought I could just carry on from where I left off on there yesterday.
I added:
$ git init Initialized empty Git repository in /home/ccuser/workspace/curriculum-a/.git/ $ git branch bio-questions fatal: Not a valid object name: 'master'. $ git branch -d bio-questions fatal: Couldn't look up commit object for HEAD $ git branch bio-questions fatal: Not a valid object name: 'master'. $
but I’ll go back to the computer I was using yesterday to see if that makes a difference.
Thank you.

I don’t think that makes a difference.

You shouldn’t have any repository there

There’s nothing here to delete

Can’t branch from nothing

I really don’t understand this.
I added:
$ git init Reinitialized existing Git repository in /home/ccuser/workspace/curriculum-a/.git/ $ git branch bio-questions fatal: Not a valid object name: 'master'.
Which, obviously didn’t work, and this error came up: Did you create a new branch called “bio-questions”?

I believe the exercises had you clone another repository? You should be in that cloned repo, not in a completely new repository

If you do git init then you gotta be able to motivate why you are creating a new repository, and why there. Forget about commands for a moment and ask yourself what it is you’re meant to do. You made a repository by cloning another repo. You should create a branch in your cloned repo

i did point out this possibility that he was in the wrong working directory, apparently not clearly enough.

Is there any way to completely delete everything I have done in the Git Teamwork lesson to restart? I think going back to the beginning of this will be easier, and refresh what I’m doing.

If you’re not currently in a repo, what can you do? You can change your position into a repo. Which repo? Well you made a clone, check if it’s there and move there if it is, then just continue. If it’s not there, then check if the original is still around, if so, just clone it, move into the clone, and carry on. If they’re both gone, that’s when the reset button seems like a good idea, because it’s only then that you’re missing something

Okay, thank you for helping.

I hope that sounds really obvious. You’re just blinding yourself by thinking about what commands you might type, without considering what you should be doing. Intention always comes first, without that there’s no point typing anything at all in. Once you’ve formed that intention you can start thinking about how to implement it.

If you feel like you’re missing information, then your intention should be to find out information, to consider what information you need, and then you can start trying to get that information.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.