Git usage with multiple .ino files

Reference: @Delta_G's git tutorial: Getting Started with Git

I've started a project to reuse and seriously modify a previous sketch.  This sketch contains mulitple .ino files, some of which are no longer needed. I decided to try Git to, it is hoped, reduce the hair-pulling factor and to gain some familiarity with it.  After initializing git per the tutorial instructions one of my first actions was to delete several of the unneeded .ino files.  When I tried to commit these changes I was stopped by a 'no changes made' message.

I assume git is only looking for changes to the file named at repository creation and is unaware of changes in other files, or even if those files exist.  Or, Git handles this and I'm just doing something wrong.

What must be done to have a change in, or deletion of, a non-named file which is part of the project be recognized by git and allow a commit?  Is it even possible?

Disclaimer: As a Git beginner I may well be using incorrect terminology or may be misunderstanding prompts/messages.

It sounds like the files you were deleting were never added to the Git repository. Git only tracks files that were added using the git add command.

I assume git is only looking for changes to the file named at repository creation.

This is not the case: no files are added to the repository when you run git init, you have to do that manually.

1 Like

There's the terminology issue, and my newbness with git.  That's what I meant to say.  I assumed the named file would bring in all the rest since they're in the same directory.  Small lesson learned.

I don't, that's why they're gone.  However, an oddity, from my perspective, occurred.  Minutes ago I went poking around and clicked on 'browse master's files'.  Lo and behold the two remaining ancillary files appear with the 'master' - and I did not explicitly add them.

However it happened, they're there and editing one invokes the same response as editing the master.

Thanks @Delta_G and @PieterP for setting me straight.

What do you mean? You cannot "edit the master": a branch like master is simply a reference to a specific commit, which is a single snapshot of the repository.

I'm not familiar with Git Gui, but you may be misinterpreting its output.

Yes, I'm sure it's a terminology thing. When clicking on 'repository' this menu appears.

image

Clicking on 'browse master's files' produces the clip of post #5.

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