Ambassador Kosh
Ambassador Kosh

Reputation: 511

Select a file to be tracked by git

I would like git to track a file, site.db, that is currently not tracked because I ran git rm --cached site.db

Since running that command I have made a few changes to the file and I would like to push it to a remote repository.

How can I do this?

When I run git status, it returns:

git status
On branch master
Your branch and 'origin/master' have diverged,
and have 52 and 1 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        deleted:    denise/site.db```

I'm worried that if I `push` then `denise/site.db` will be deleted, when I actually want to push it!

Upvotes: 0

Views: 40

Answers (1)

Joshua Zeltser
Joshua Zeltser

Reputation: 598

If you do git add of that file it should readd it

Upvotes: 1

Related Questions