git commit not working with Git Bash

git commit example
git commit command with message
git commit and push
git commit message
git commit -m means
git commit file
git push command
git commit vs push

I am newbie in GIT. When I try to commit some files and it gives me the following warnings:

modified content, untracked content

My folder structure like:

.git

   ---- files

   ----- another-folder

   ---- .git

   ---- files

----- another-folder

---- .git

 ---- files

I was downloading git repository for learning purpose and move all downloading files into my repository. Looking forward to the answer. Thanks in advance.

The files should be added to the index (locally) first. You can do this by executing the add command like this:

git add --all

or

git add somefile.txt

After the files have been added, you can commit them.

git commit - Saving changes to the local repository, Also note that in Git (not like in Subversion), a commit is not automatically If you have lots of changed files in your working copy - and want all of them included  git add . && \ git add -u && \ git commit -m "$(read -p 'Commit description: ')" && \ git push origin HEAD If any command fails, it will stop evaluating the remaining commands. Just food for thought (untested food).

git commit doesn't work in windows git bash, If you're using Git Bash then the commands will work exactly the I'm on a Windows environment as well, and I had a problem here where  I was not able to find an open or closed issue matching what I'm seeing Setup Which version of Git for Windows are you using? Is it 32-bit or 64-bit? git version 2.16.1.windows.4 cpu: x86_64 built from commit: ef6d451bbfef86a529ebf126202

Git is showing that because it is detecting some files which are modified but not yet tracked by you. To do that, run:

git add filename

This will track the file and stage them on the index. You can commit after that.

However, there might be some folders or files that you want to ignore. In that case, make a .gitignore file and add them in each line.

.gitignore

# a comment
aDir/
somefile.txt

You can also specify glob patterns to match a group of files.

# * matches 0 or more characters 
*.txt

For more details, check out .gitignore docs.

git-commit Documentation, by using git-rm[1] to remove files from the working tree and the index, again before not work properly on UTF-8-based systems (e.g. Linux, Mac, Windows) and  Another thing is git-bash.exe should not be open in the post installation process, if it was, nothing can touch it and it will work perfectly :) I should also say that this git-bash.exe has an icon at beggining, and it will gone after post-install process :

Git on the commandline, merge changes on GitHub into your local clone. So far we've done all our Git work using the GitHub website, but that's usually not the most appropriate way to work  git add hello.py git commit --amend. This will once again, open up the configured text editor. This time, however, it will be pre-filled with the commit message we previously entered. This indicates that we are not creating a new commit, but editing the last. Summary. The git commit command is one of the

Git Commit, Saving changes in a repo: git add adds a change in the working directory to the staging area. git commit commits the staged snapshot to the project history. Install Git · Install Git on Mac OS X Install Git on Windows Install Git on Linux · Git SSH · Git archive · GitOps in every commit. Git Tutorial: Snapshots, Not Differences. Git has a staging area, for files that you want to commit. On GitHub when you edit a file, you commit it as soon as you save it. On your machine, you can edit a number of files and commit them altogether. Staging a file in Git’s terminology means adding it to the staging area, in preparation for a commit. Add your amended file to the staging

My committed/pushed changes to master don't show i, Dear Git experts, I am not an Git expert. to figure out how to use command line eventhough I see Git Bash Here and Git GUI Here options. When I am done with my development work, I just click Git Commit --> specify a  A file can be reverted back, only in the index but not in the working tree, to that of the last commit with git restore --staged <file>, which effectively reverts git add and prevents the changes to this file from participating in the next commit.

Comments
  • That's not a warning, that's just how git works. It's simply letting you know what files have been modified but aren't selected for inclusion in this commit.
  • I wouldn't execute commands without knowing what they do. Happy it worked for md sajib but the answer is far from reusable as it is. Just sayin'
  • It's making sure those directories aren't their own repository, after cleaning out git knew about them beforehand and then re-added them fresh.