N
N
Nohaga2019-09-16 16:09:57
git
Nohaga, 2019-09-16 16:09:57

Why can't commit to git?

Here is the Git Gui program, I make a new repository, change and add files there, make a stage and then press commit, and it says to me that there were no changes and cannot send a commit. And why is this happening?
5d7f89879a6bd419739750.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Dergachev, 2019-09-16
@Nohaga

Judging by the screenshot, there are no changes at all (the "Unstaged Changes" area is empty, the "Staged Changes" area is empty). If there are still changes, then you can check if the files have been added to .gitignore. Edit this file as needed and check if there are changes displayed.
If there is no .gitignore file, or it is empty, or the files that you changed are not included there, then open the command line anyway and check in your clone:
​​^-- will display file changes and files that are tracked / not tracked.
^-- will add the file for change control
^-- will indicate that the file has been added ^-- will commit the changes The following is an example of how this might happen when using .gitignore

[email protected]:~/Projects/temp$ ls -a
.  ..
[email protected]:~/Projects/temp$ git init
Initialized empty Git repository in /home/boris/Projects/temp/.git/
[email protected]:~/Projects/temp$ touch filename
[email protected]:~/Projects/temp$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

  filename

nothing added to commit but untracked files present (use "git add" to track)
[email protected]:~/Projects/temp$ echo filename > .gitignore
[email protected]:~/Projects/temp$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

  .gitignore

nothing added to commit but untracked files present (use "git add" to track)
[email protected]:~/Projects/temp$

From the last listing, you can see that if a file is added to .gitignore, then it will not be displayed when tracking changes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question