Questions tagged [git-commit]

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

git-commit
Filter by
Sorted by
Tagged with
4 votes
1 answer
4k views

My commits appear as another user in GitHub?

I am trying to set up git on my laptop so I can push commits to GitHub. This now works, but if I do so and then visit GitHub, it appears as if some random user (always cbeaudoin898 - I have no idea ...
bende's user avatar
  • 193
1 vote
1 answer
84 views

GitHub - Get the author (not the committer) of an old commit

I am trying to get the author on GitHub (and not only the committer) of an old commit +90 days. To say differently, an old commit was committed when naming my account differently (committer = ABC for ...
ADR8DA's user avatar
  • 11
1 vote
1 answer
430 views

List commits of a specific merge-commit - children only

How can I list the commits of a specific merge-commit 845884. Here, for instance, I only want commits 1, 2, 3 and only them * 845884... Merged branch xxxx |\ | * 68daa7... commit 3 * | a58ec2... ...
Stef's user avatar
  • 3,742
0 votes
1 answer
49 views

How find all commits which modified custom file or date interval? GIT

I have deleted my local branch without pushing about 3 months ago, I do not know how to find it, but I know that there should be a commit which modifies x.cs file. How can I find all commits which ...
Jon's user avatar
  • 31
0 votes
1 answer
45 views

Is there anyway to recover a missing git commit?

I've been working with a detached head for longer than I should have granted. I've been lazy and put off merging back into the branch I was originally working in and finally decided that it was high ...
JohnN's user avatar
  • 970
1 vote
1 answer
80 views

Apply changes to an existing commit without interactive rebasing

Sometimes (very often) I make a change on my code base which I want to be part of a specific (not yet published) commit. Usually I stash my changes, rebase -i ID^ to that commit stash pop and --amend ...
frans's user avatar
  • 9,382
0 votes
0 answers
178 views

How do I configure a remote to have a fixed receive pack?

I have a git bare repository on my server which has a post-receive hook that essentially does GIT_WORK_TREE=`/path/to/public_html` git checkout -f Whenever I do a push from my local repo to this ...
Saifur Rahman Mohsin's user avatar
1 vote
1 answer
881 views

Which git command give me only merge commits for the master branch?

I just merged PR to the master. I want to log all the merges commits. So which git command give me only merge commits for the master branch?
Jack Bury's user avatar
  • 165
0 votes
2 answers
469 views

How to change the commit history in GitHub?

I have tried git rebase in interactive mode to squash commits. I have also tried git reset in soft mode, then made a single commit. It seems to have changed my git log. But when I need to push to ...
aahnik's user avatar
  • 1,781
0 votes
1 answer
263 views

How to pull my second last or n'th last push

When I run git log, I see: commit d0fa4410393w92ce6ede2ea26fa2fb74z2e5f1bz (HEAD -> notificationControls, origin/notificationControls) Author: stufezic-dev <[email protected]> Date: Sat ...
horxCoder's user avatar
  • 165
1 vote
1 answer
305 views

How can I rebase with only commits that affect certain files?

Let's say I have 100 commits in a repository, and I want to rebase only the commits that affect three files: foo, bar, baz. How can I do this? Obviously theoretically those commits could affect other ...
Evan Carroll's user avatar
1 vote
2 answers
896 views

Signoff previous in between commits in git

I have a branch where there are multiple commits as below Commit 1 - Not signed Commit 2 - Signed off X Commit 3 - Not signed Commit 4 - Not signed Commit 5 - Signed off by Y i would like to signoff ...
srinath's user avatar
  • 2,868
0 votes
1 answer
51 views

How to write full message while commiting with git?

This is how I commit with git : git add -A git commit -m 'added theme color and image error handling' But it throws an error for the commit message : error: pathspec 'theme' did not match any file(s) ...
Mehdi Faraji's user avatar
  • 3,356
5 votes
3 answers
10k views

How to undo a commit after a failed push?

I was going to test something in dev branch (just a version number 0.1 --> 0.2), so I committed the change but I don't have the permission to push it to dev directly,then I created a feature branch ...
wawawa's user avatar
  • 3,115
0 votes
0 answers
212 views

How to use Github with VSC

I am a mac user new to github and visual studio code, so I apologize if I missed something obvious. My problem is that after reading the official docs, I cannot figure out how to actual get github to ...
timg's user avatar
  • 391
-1 votes
1 answer
92 views

For already git tracked file, can we commit changes without adding them in GIT

I have file which tracked by GIT in my local repository. Now, if I make changes in that file, standard process is as follows. e.g. for file demo.txt, git add demo.txt git commit -m "changes done&...
Ravi Kulkarni's user avatar
0 votes
0 answers
85 views

How to save all versions of a project build with git in different repositories

I'm a beginner in git, I have learned the basics of git and started working on my web project with git. Now after a month working on it, I have created more than 10 versions and with each version, I ...
user8802979's user avatar
0 votes
2 answers
108 views

Is there a syntax for referring to the commit which followed a commit in branch history?

If I have a specific hash, call it A, I can get to the parent by A^. But is there a way to get to the commit that followed A in the branch history? Something like A+1, such that A is (A+1)^? I want to ...
temporary_user_name's user avatar
1 vote
1 answer
293 views

How to remove commits from history for the files that no longer exist in the repo

So my Github repo contains many projects over the years, and now there are only a couple remaining. Is it possible to clean my commit history so that instead of thousands of commits about files/...
nismoh's user avatar
  • 63
1 vote
1 answer
303 views

git: how to get/merge old commit from same branch(ie master)?

I am using git using and want to get code from previous commits to the head. I have figured out a way to do this but that seems more like a hack, I am wondering if there is a better way of doing it. ...
Zarak Khan's user avatar
3 votes
3 answers
8k views

Checking out previous commit with Github and VS Code

I accidentally made a commit that I should not have to the master of my project in GitHub. I am now trying to checkout to a previous commit using VS Code. I got the URL of that commit. I do have the ...
Alexander's user avatar
  • 280
2 votes
0 answers
376 views

Github Desktop Commit to master button greyed out if more than one change slected

I have a lot of stuff that I want to add to github so I have the desktop version to make local changes. I add everything I have and before I can push it I have to commit to master, problem is I have ...
RavingLunitic's user avatar
0 votes
2 answers
1k views

Can't switch git branch after committing changes

I am working on an Xcode project in macOS. The project is also under git version control. I have a branch in git that I created off of my local master branch. I have done some substantial work in it ...
Tron Thomas's user avatar
1 vote
3 answers
1k views

Is it possible to set multiple user emails in git config?

Is there a possibility of setting multiple user emails? I'm trying to associate all future commits with several emails so that, for example, they could be found in GitHub/GitLab/(etc) UI by either of ...
Parzh from Ukraine's user avatar
0 votes
1 answer
252 views

Light and fast Git Export and fetch commit-id

How does one export a remote git repository to a local space, only taking the head revision of a given branch, and then for each exported file, acquire the commit-id of that file? What I have tried so ...
Sean B. Durkin's user avatar
2 votes
1 answer
1k views

How to modify old, pushed commit, with new commits pushed after it

I am in the process of migrating a repo from gitlab to github, as our repo ran out of space there, and it doesn't seem as though we can expand it's size. So, naturally, I created the new repo on ...
Chris McCole's user avatar
1 vote
2 answers
2k views

"git fetch" doesn't update commit history in "git log"

I'm new to git workflow and was following a tutorial online about "git fetch". Here are the performed steps: "git pull" to synchronize files and history from remote repo A new ...
Alagusankar's user avatar
6 votes
3 answers
3k views

Can I merge the commits made to a fork back to the original project?

Despite programming for a few years now, I'm still trying to wrap my head around some concepts when it comes to Git. To illustrate what I'm asking, let's set the stage with a hypothetical situation: ...
Jonathin's user avatar
  • 127
4 votes
3 answers
3k views

pre-commit works fine, but git commit fails

so in my project, there are serveral pre-commit hooks to make sure our codes meet team standard, but whenever i try to commit changes, there is always an error saying executable was not found. usually,...
yunu's user avatar
  • 101
-1 votes
2 answers
51 views

Git commit as part of previous commit [duplicate]

Is it possible to commit your changes as part of a previous commit? Like add to your most recent commit with whatever you just changed?
Palpable Coral's user avatar
2 votes
1 answer
2k views

fatal: Could not parse object '4eb38c748f77b51ffcde8684dfea173af2e33e7b'

I am trying this git reset --hard 4eb38c748f77b51ffcde8684dfea173af2e33e7b I am getting an error fatal: Could not parse object '4eb38c748f77b51ffcde8684dfea173af2e33e7b'. Why would I get this error? ...
Veena's user avatar
  • 29
-3 votes
1 answer
43 views

How to revert both local and remote git repository to a previous commit?

I want every commit after the one with hash ac9edf2 to disappear entirely from my local repository and the one on Github. Trying to following instructions based on previous answers is like trying to ...
GirkovArpa's user avatar
  • 4,633
3 votes
0 answers
378 views

Git - rewrite commit authors when pushing to mirror repository

We have a git repository. There is branch A and there is branch B. They have the same contents. New commits are added to branch A. The problem: Create a script that takes all new commits from branch A,...
Sulthan's user avatar
  • 129k
0 votes
0 answers
2k views

Getting "env: bash\r: No such file or directory" I am using Mac terminal and having this issue while doing git commit

I am new to programming and have created a repository on Git. I am trying to add my project folder to Git repo. In order to that, I am using the following set of commands: git init git add . ...
Sharad Sawhney's user avatar
0 votes
1 answer
197 views

Git reset HEAD~1 goes to the wrong commit

I read about commits, parents, and ancestors. To get more clarification, I tried to experiment with it and created a test git repo. My goal was to merge 3 branches into the master branch to understand ...
Haris Muzaffar's user avatar
1 vote
0 answers
905 views

Git commit gone from VS 2019: what happened?

I recently updated VS 2019 to 16.7.1. Now I wanted to commit changes to my local repo and to the github repo. But alas: the commit is gone from the solution pull-down. I only have a git option (with &...
Erik's user avatar
  • 914
-1 votes
1 answer
46 views

Recover code from older commits of a particular branch

I have a branch A. In that branch I have done several commits for eg. Commit 5 Commit 4 Commit 3 Commit 2 Commit 1 Where commit 1 is the oldest one. All the commits were pushed successfully and i can ...
Peace9795's user avatar
5 votes
1 answer
3k views

Why do I suddenly have a merge commit in my pushes?

Well, I seem to have gone and mucked something up. Until just recently, I used to be able to do a merge commit and then push to origin without that separate commit showing up. Now that it does, the ...
InteXX's user avatar
  • 6,207
0 votes
1 answer
230 views

How can I merge the local dev code with remote

My colleague create new branches for the project: R1, R2 Running on my machine I have the branches: Dev1 and Master I did a git pull but the remote branch didn't appears to me. After trying something ...
user428745's user avatar
1 vote
1 answer
181 views

Join commit history of a subtree

There is a git repository where part of it was copy-pasted from another repository and commited all in a single commit at some point. Since then many changes were made. I want to add past commit ...
Hedede's user avatar
  • 1,153
1 vote
0 answers
318 views

Git prepare-commit-msg

My Code: COMMIT_MSG_FILE=$1 COMMIT_SOURCE=$2 SHA1=$3 git diff --cached --name-status > ./.git/test.txt git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p'>> .git/test....
zBugi's user avatar
  • 13
0 votes
1 answer
283 views

Is it possible to do multi-line commits with GitAhead

I currently used GitAhead as my primary GUI for interfacing git source control. My question is if it is possible to support multi-line commits messages with GitAhead? My first thought is there might ...
Paul Renton's user avatar
  • 2,650
3 votes
1 answer
817 views

git.push() works but the commit on github is empty

I use isomorphic-git in the browser (Chrome at the moment) to try to save code on github After I clone a private github repository, I am trying to add new files to it, do a commit and push it back on ...
Ailete619's user avatar
  • 224
0 votes
1 answer
189 views

How to find the commit message using BLOB SHA1

I am a beginner in GIT and trying to do some validation with Bit Bucket objects. I am using the below script to find all the objects in a branch: git ls-tree -r branch-name This gives me the object ...
Rahul Raj's user avatar
0 votes
0 answers
782 views

How to replace a file for all git commits if I've already pushed?

I accidentally published sensitive information instead of putting a sample image for two files in two commits a few months ago on our company's main website repo. I shared two pics at images/Example....
JoeVictor's user avatar
  • 1,838
1 vote
1 answer
313 views

Git successfully stages file but fails to commit the file

Git successfully stages the files via git add (they show up under "Changes to be committed"), but when I run git commit -m "commit message" and friends, the command silently fails (...
pooley1994's user avatar
-1 votes
1 answer
191 views

How to add an old .git repository to a project as an old branch

I have searched but I haven't found the solution. Maybe I wasn't persistent enough in my research. If I've missed something, I'd be grateful if you send some links. I have worked with some guy on the ...
GZstudio GZstudio's user avatar
1 vote
1 answer
85 views

Could git open vim editor at line N whenever we are creating commit?

I working in a project where each commit in a branch MUST start with Story PRJCT-NAME-42 Task description And must contain a message like this Story PRJCT-NAME-42 Task description foo bar ...
sensorario's user avatar
  • 20.9k
6 votes
1 answer
2k views

Disable Git Global Username and Email

I want to disable the option for my git users that they can set a global username and email. I want it to be empty at all. Now I have the problem, that when some of them set the global user.name and ...
arash yousefi's user avatar
2 votes
2 answers
2k views

git commit -m "add !empty check" zsh: event not found: empty

I just observed having ! before a git commit message triggers events in zsh. Not sure if it's zsh issue or git feature. Please explain.
Jagadesha NH's user avatar
  • 2,639

1
11 12
13
14 15
44