Dman100
Dman100

Reputation: 747

Having trouble commiting a change to repo

I'm using GIT from the command line and trying to commit some changes I've made to the repo. I'm new with GIT, so I'm sure I'm missing something pretty simple.

I've navigated to the directory where the project resides and am in the directory where the file is located that I want to commit. I'm trying to update the gemfile to include 'minintest'

I tried:

git commit gemfile -m added minitest to gemfile

error: pathspec 'gemfile' did not match any file(s) known to git

Sorry for the novice question. I'm brand new to using git.

Thanks.

Upvotes: 0

Views: 28

Answers (1)

ThiefMaster
ThiefMaster

Reputation: 318468

You need to git add gemfile to add the file to the staging section. Then you can commit it using git commit (optionally add -m "the commit message" if you do not want git to launch your $EDITOR).

Another option would be using git commit -a which commits all changed files (as long as they are already tracked) in case you don't have any changes that you don't want to commit.

Upvotes: 2

Related Questions