I\'m trying to add a ruby rails file to my repository in gitlab but it somehow wouldn\'t allow me to add the file saying that my file does not have commit checked out.
To add to Mario's (correct) answer and resolve this type of issue which can be quite common (e.g.in scaffolding an application using an app generator inside a repository top folder, and it generates its own .git file), you can run the following commands to cleanup and get the files checked in properly to git.
cd {{appname}}
rm -rf .git
# rm -r -fo .git # if on Windows powershell
cd ..
git add .