Questions tagged [git-commit]

git-commit - Record changes to the repository along with a log message.

Stores the current contents of the index in a new commit along with a log message from the user describing the changes.

Added from reference

2117 questions
107
votes
5 answers

How to see which commit a git submodule points at

As far as I understand, if you add a submodule in git, then the main repo contains a pointer to a certain commit of the submodule. Is there any way to see to which commit the main repo points at for a specific submodule, without checking out the…
gitaarik
  • 42,736
  • 12
  • 98
  • 105
104
votes
3 answers

git log show one commit id only

I need some help. It is possible to only show one commit id? Since git log -3 show the log from 1 - 3, I just want to show only 3. What possible command will match for it? I use the command git log -3 --pretty=format:"%h" the result…
rkevx21
  • 2,441
  • 5
  • 19
  • 40
101
votes
8 answers

How to get the last commit ID of a remote repo using curl-like command?

I want to get the last commit ID of the remote git repo. The command git rev-parse HEAD works for a locally-cloned git repo, but I want to get it from the original GIT repo by a CURL command or so. Eg: I want to get the last commit ID of the git…
Manisha Eleperuma
  • 1,089
  • 2
  • 7
  • 7
101
votes
7 answers

Can I edit two files then make one commit using GitHub Web-based editor?

GitHub has the nice feature of Web-based file editing. However, it seems that after editing one file I have to commit the changes for this file before continuing. Is there a way I can edit two or more files then make one commit for all the changes…
shengbinmeng
  • 1,517
  • 2
  • 12
  • 22
99
votes
17 answers

Git commit opens blank text file, for what?

In all the Git tutorials I've read they say that you can do: git init git add . git commit When I do that I get a big text file opened up. None of the tutorials seem to address this, so I don't know what to do with the file or what to put in it if…
Alex
94
votes
4 answers

Git Hub Desktop on Mac, error: cannot run gpg: No such file or directory

Trying to commit my changes by using GitHub Desktop and getting this: error: cannot run gpg: No such file or directory error: could not run gpg. fatal: failed to write commit object (128) Firstly that not worked for terminal too and i create…
Ilia Rebane
  • 1,251
  • 1
  • 9
  • 10
93
votes
6 answers

How do I get last commit date from git repository?

I need the last commit date in git. This means the latest update date in my program. I used the command : $ git log -1 but this command will give me the date from the local repository. Rather I need date from remote repository. I tried some…
Narendra Vadnere
  • 931
  • 1
  • 6
  • 4
81
votes
4 answers

Git & Intellij, How do I commit only parts of a changed file

I can't seem to commit only a fraction of the changes in a file, it seems to be all of the file or nothing, I'm using Git with Intellij, is it possible? Thanks.
Jordan
  • 1,131
  • 2
  • 8
  • 11
81
votes
2 answers

Pull-Request for only certain files/commits

I have a repository that is forked from GitHub that has a few modifications made to it. However, in a certain commit, a few files were changed that I want to submit a pull-request for, leaving the other modified files out of the request. Do pull…
Qix - MONICA WAS MISTREATED
  • 14,451
  • 16
  • 82
  • 145
80
votes
3 answers

Standard to follow when writing git commit messages

I find myself managing very many files (over 60 but below 70) and my commit messages so far follow this pattern: when I have added something like on layout.css, my commit message is "added something on layout.css file", and when I remove something,…
Gandalf
  • 1
  • 29
  • 94
  • 165
79
votes
8 answers

Git still showing deleted files after a commit

How can I remove deleted files from my Git repo? I've deleted a folder of a JavaScript library, which contained many files. I then went to commit the changes like so: git add . git commit "message" git status But it shows all those files as…
Nik So
  • 16,683
  • 21
  • 74
  • 108
79
votes
10 answers

Why does git fail to fetch specific valid submodule for a given commit and how to fix it?

I have a git repo which has another one as a submodule dependency. In the root of my project (where the .git, .gitsubmodules etc. are) I called git submodule update This failed with the following message: Fetched in submodule path 'src/framework',…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
75
votes
4 answers

Graphics in GitHub commit messages

How to add graphics/image in git commit messages (pushed to Github)?
y2p
  • 4,791
  • 10
  • 40
  • 56
70
votes
3 answers

How to rollback everything to previous commit

Recently in a project with multiple people, a commit was made as seen in the image below. Marked in red you can see a commit with the description/comment of 'Merge?'. This commit added numerous files and altered numerous others and was never…
captainrad
  • 3,760
  • 16
  • 41
  • 74
69
votes
3 answers

How to see commits that were merged in to a merge commit?

If my-feature-branch was merged into my-main-branch, how can I see what commits were merged in from my-feature-branch?
The Pixel Developer
  • 13,282
  • 10
  • 43
  • 60