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
54
votes
4 answers

fatal: No existing author found with 'XXX'

I used git for the first time and I set my user name and user mail. The commands I used are below: git config --global user.email "bob@example.com" git config user.email "bob@example.com" git config --global user.name "bob" git config user.name…
user2362956
53
votes
2 answers

What flow causes Github commits that are "authored" by one user but "committed" by another?

For example, this commit is claimed to be authored by mattcaswell and committed by richsalz What usage flow could have caused this? Suppose I want a commit which is authored by someone else and committed by me to appear in a repo where I'm a…
sharptooth
  • 167,383
  • 100
  • 513
  • 979
51
votes
13 answers

git status (nothing to commit, working directory clean), however with changes commited

I found many questions with similar subject, but I didn't found any practical guidance about this issue: why git status informs me nothing to commit, working directory clean, even tough I have made a modification at my local branch? Here are the…
ivanleoncz
  • 9,070
  • 7
  • 57
  • 49
51
votes
16 answers

Troubleshooting misplaced .git directory (nothing to commit)

I started getting this message. No matter what I edit and try to commit, it says there is nothing to commit. Looks like git does not see my working directory and looking somewhere else. If I run git status it outputs the same: nothing to commit…
Andrius
  • 19,658
  • 37
  • 143
  • 243
48
votes
1 answer

How to undo git reset --soft to get my changes back?

I had some local changes in my directory that I committed using git commit. Later I realized that by mistake my changes broke my build. So I did a git reset --soft on my repo. But I screwed up, as I did not back up the changes that were all undone,…
dennis
  • 680
  • 1
  • 5
  • 11
43
votes
3 answers

Change git email for previous commits

So I read a lot about how to change previous commit's email address but for some reason mine is not updating. I did like 40 commits to my private repo with my local email (nameofMyComputer@kevin.local) which is bad since this email is not…
Kevin Cohen
  • 1,211
  • 2
  • 15
  • 22
42
votes
6 answers

PHP: Is there a reason to put a newline at the end of file

When I commit a php file to github I get the message "No newline at end of file". It's just a warning and I remember, that for any reason it is good to have a newline at the end of a file. But why? Is it a remnant of long gone times, does it still…
Christian Kolb
  • 1,368
  • 2
  • 23
  • 43
42
votes
3 answers

Pushing code from one branch of a repo to another branch of another repo

There is a repo say ABC/A. I had forked this repo to my own github say ME/A. I was asked to create a branch on ME/A say x (originally there were develop and master). I had to write some code, so I cloned ABC/A and worked on its develop branch. But…
user3119346
  • 463
  • 2
  • 6
  • 12
42
votes
4 answers

Track file inside ignored directory

Some time ago I set up my .gitignore file to not track a folder my_folder with: my_folder/ Now I want to track only a given file inside said folder, named my_file.md. After making .gitignore look like this: my_folder/ !my_folder/my_file.md and…
Gabriel
  • 40,504
  • 73
  • 230
  • 404
42
votes
4 answers

Is it possible to set a git commit to have a timestamp prior to 1970?

Unix timestamps are signed 32 bit integers (64 bit on some systems today, or so I understand). On some software products this allows you to use dates going back as far as 1903 or so. However, when I try the following: git commit -m "this is a test…
John O
  • 4,863
  • 8
  • 45
  • 78
42
votes
5 answers

File not shown in git diff after a git add. How do I know it will be committed?

I had an untracked file which was not appearing in a git diff and when I added it to the 'changes to be committed' area, it still doesn't show up in the git diff. I shows up with a git status -v when I do a diff against HEAD. I'm still very new to…
Kitty1911
  • 661
  • 1
  • 8
  • 15
41
votes
10 answers

Git, error: remote unpack failed: unable to create temporary object directory - By creating new Branch

I'm trying to create a new branch in my repo. I did this: git branch events git Checkout events That worked. So I changed some files and did: git Status git add --all git commit -m "Commit" That worked well but I tried to push it and that didn't…
Störungs Sucher
  • 439
  • 1
  • 4
  • 8
41
votes
2 answers

How to find the branch from commit id

So, I am trying to find branch name in which a given commit was made. (c853d8cf3ae34dae9866b874b96c6529515d7e90) I have the parent id and commit id referenced on the git issue. How can I find that given commit id was pushed in 'x' branch?
PriyankaK
  • 925
  • 2
  • 10
  • 18
40
votes
3 answers

Pull in changes from a Github fork

Someone forked a Github project of mine and made some changes. How can I merge the changes back in to my upstream version? Also, is it possible to pull in just a specific commit? What I'm looking is if there is a way to pull a specific commit…
gregghz
  • 3,925
  • 7
  • 40
  • 69
40
votes
2 answers

Can I use a scripted commit template for git?

We are working on tickets, and when we use the ticket number in the git commit message on the first line, then the ticket is updated with the commit message. To make things simple we always work on a branch with the commit number. Now I'd like to be…
Peter Tillemans
  • 34,983
  • 11
  • 83
  • 114