Questions tagged [git-commit]

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

git-commit
Filter by
Sorted by
Tagged with
20 votes
2 answers
22k views

How to make a git pre-commit hook that checks the commit message?

I have a git commit hook script, that checks the commit message, and if the message does not contain the word "updated", the script should reject the commit. #!/bin/bash read -p "Enter a commit ...
Андрей Ка's user avatar
0 votes
3 answers
4k views

How to separate title from body in a git commit message using Notepad++?

I am using git on windows and when I use the commit command in the command prompt, my Notepad++ opens up and asks me to put in a commit message as follows: # Please enter the commit message for your ...
splinter's user avatar
  • 3,837
5 votes
1 answer
9k views

How to delete any commit from commits table in Gitlab?

In this image you can see list of commit, I want to delete one of them, but I could not find the delete option.
Muhammad Naveed's user avatar
1 vote
0 answers
114 views

Git 3 branches merge with every 2 branches having no conflict

I am discussing about git merge issues with a colleague of mine. And I come to a question. There are three branches from a same branch: b1 b2 b3. The three branches have unique modifications(commits). ...
smallgoodboy's user avatar
0 votes
2 answers
2k views

What does git core.commentChar=auto do?

I'm testing git commentChar=auto with git-commit for a library that must emulate git-commit for some purposes. If I run git commit -m "#message", and then make a second commit which open the editor ...
Elliott Beach's user avatar
11 votes
1 answer
2k views

How to check if a merge commit contains manual changes (e.g. resolved conflicts)?

How can I find out if there were conflicts when merging a branch and what shenanigans did the person have to do to resolve those conflicts? git log -p seems to show empty diffs for all merge ...
Eugene Yarmash's user avatar
1 vote
1 answer
685 views

How can I programmatically link a commit to a work item in TFS? (need second GUID in LinkedArtifactURI)

I am attempting to programmatically link a commit to a work item in TFS and I think I'm close. When creating a new ExternalLink, I'm struggling to form the LinkedArtifactUri property. I can run a ...
user95227's user avatar
  • 1,893
9 votes
1 answer
2k views

git push rejected, merge conflicts, git pull --rebase

I'm trying to push my commit, but couldn't since there is another commit (same-level in the HEAD race :) I know I need to merge those two commits together, not exactly sure how to do it. I already ...
Hi_im_MrMee6's user avatar
8 votes
2 answers
6k views

Why is Git merge creating multiple commits on master branch?

There are two branches I am working with, master and newFeature. While building the "new feature", I added multiple commits to the newFeature branch. My understanding of git merge is that it will ...
John Smith's user avatar
  • 7,313
1 vote
2 answers
628 views

Path error when edit/commit file on Gitlab site

I'm trying to edit a .txt file on the (our) gitlab website but on commit the following error appears: Path can contain only letters, digits, '_', '-', '@', '+' and '.'. I guess the error is caused ...
zypro's user avatar
  • 1,178
2 votes
1 answer
135 views

How to find a component with the most commits?

As a tester, in the past, I was often able to find a defect-prone component in our system but looking for those which were often changed. In SVN, I knew how to do it but in GitHub, I cannot seem to ...
John V's user avatar
  • 4,955
1 vote
2 answers
2k views

Github Commit Hash in Javascript or React.js

I am trying to create a Javascript component that replaces the static HTML element Demo v0.1 into the shortened GitHub Commit Hash, e.g. 6da724d <div className ="demo-version"> Demo v0.1 &...
huisleona's user avatar
4 votes
3 answers
452 views

What does the git documentation mean by 'unwrapped subject and body' for %B pretty print specifier

If you search for %b and %B in the documentation, there is no explanation of the difference between them apart from the cryptic "(unwrapped subject and body)". Here is an example commit from a repo (...
ely's user avatar
  • 76.1k
3 votes
1 answer
144 views

Restrict or change color of specific line in Vim

I use Vim for git commits. I have created a .gitcommittemplate: ############################### <BASLIK> ############################### # # ... # # |--En fazla 50 Karakter olabilir(Max 50 Char)...
reladawrefurhost's user avatar
1 vote
1 answer
34 views

GIT: remove from 2nd to 5th commits in the remote branch

I'd like to fully remove several commits in the remote branch. Reason: The branch with the only important (and the most recent) commit supposed to be forked from and merged into another branch. Once ...
Haradzieniec's user avatar
  • 9,234
1 vote
1 answer
312 views

Changes not staging during Python subprocess call of empty commit

At the end of a Python program I have: subprocess.call(["git", "add", "."], shell=True) subprocess.call(["git", "commit", "-m", "'{}'".format("commit message"), "--allow-empty"], shell=True) This ...
BigMike's user avatar
  • 11
0 votes
1 answer
47 views

Git change branch historically

When I look at my repository network on https://github.com/user/repo/network, the graph of my repo looks like this: Shown: ------------ A2 (branch a) | A0 -- A1 -- B0 (branch b) | ...
Tivaro's user avatar
  • 177
-1 votes
2 answers
72 views

How to setup git on ubutu server? [closed]

I want to configure git on ubutu server and commit our source code using shell command. Thanks
Priyanka Sankhala's user avatar
3 votes
3 answers
4k views

git commit asking for who you are

I ran into below error message while trying to make some commits. *** Please tell me who you are. Run git config --global user.email "[email protected]" git config --global user.name ...
MaxG's user avatar
  • 199
9 votes
2 answers
2k views

How to view git commits when local branch is ahead of origin Commits

I want to view git commits when my branch is ahead of origin branch. i tried git log it returns all commits. but, i want to view only ahead commits from branch to origin/branch here what i mean, ...
Mohideen bin Mohammed's user avatar
0 votes
0 answers
48 views

Git: first commit gets lost after the second commit

I only did some commits locally without pushing to the remote by using Eclipse. And this happened: After I did the second commit, my first commit disappeared and the files included in the first ...
Luke_Z's user avatar
  • 11
1 vote
2 answers
6k views

Git-merge error

I am trying to practice contributing to other repositories on Github but I am getting an errors while I try merging 2 branches: error: Your local changes to the following files would be overwritten ...
Omar's user avatar
  • 49
6 votes
0 answers
506 views

nodegit - how to get lines added/removed in a commit filewise?

I am new to nodegit. I want to see most recent 10 commits for a repo, files changed and changes introduced in respective commits. I have got list of 10 most recent commits, but I am stuck on getting ...
srikant's user avatar
  • 260
0 votes
3 answers
3k views

Modify git config file globally

We would like to change the git config file globally, such that new file get downloaded from git repo on every git clone. Is there a way to do so? Any user who does git clone of the project should get ...
Dheeraj Manthangode's user avatar
1 vote
1 answer
50 views

I have added a folder with say 10 files and committed the changes.

Now I have removed 5 of those files and I want to amend these changes to the last commit.I havent pushed the commit..Am using gerrit. However when I do git status it shows me Changes not staged for ...
user3800888's user avatar
70 votes
6 answers
13k views

IntelliJ IDEA - Asterisk after author's name in git log

In our git log we sometimes see an asterisk after the user name in the Author column. The same user is listed without the asterisk in other commits. What does the asterisk stand for? I'm using ...
FeinesFabi's user avatar
  • 1,177
1 vote
1 answer
1k views

Visual studio code is git pushing but repo does not match

I can't figure this out I normally do my github commits like so (just using command prompt) command prompt → cd to the directory → git add . → git commit -m "Commit Message" → git push origin master ...
Vincent Tang's user avatar
  • 3,962
0 votes
0 answers
62 views

Delete Github Commits

Im trying to host my personal website on Github. I was logged in as different user on Gitbash and pushed the code. In that repository I could see contributors as 2 and few commits which I would like ...
user8145610's user avatar
4 votes
3 answers
3k views

Git - Diff between branches in old commits

I have this: branch: commit 1, commit 2, 3,4 master: commit 1, commit 2, 3,4,5,6,7 How can you make a diff between branch after commit 2 (in that point of history) and master in commit 3?
joel's user avatar
  • 59
4 votes
3 answers
2k views

How to list all files added to the first commit of a GIT repository?

Current status: I am using git diff-tree -r HASH to list all added, modified and deleted files in a specific commit. This worked until today. The problem: I want to list all added files in my first ...
Lawrence's user avatar
  • 338
1 vote
1 answer
730 views

The working copy '<Project Name>' failed to commit files - Couldn't communicate with helper application - Solution not working

I am referring to a previous question with answers: The working copy '<Project Name>' failed to commit files - Couldnt communicate with helper application Yet, the answer does not work ...
manjulapra's user avatar
0 votes
1 answer
35 views

Figure out which git commit a directory is from?

I have a git repository (let's call it MyRepo), a local working clone of the git repository, and a copy of a subdirectory of the main git repository from some other machine (let's call it ...
starbeamrainbowlabs's user avatar
3 votes
2 answers
2k views

How to split a Git commit that contains a refactoring?

I have created a commit in my local Git repository that includes a functional change and a refactoring. In retrospect, it would have been better if I had created a separate commit for the refactoring: ...
oberlies's user avatar
  • 11.6k
12 votes
4 answers
35k views

How to Squash 3 commits into 1?

I'm fairly new to git, so I've been trying to figure out how to squash 3 commits into 1 so my PR can get merged. I've read a lot of docs and guides and sort of found out how to squash commits but one ...
Kaycee's user avatar
  • 123
1 vote
0 answers
250 views

Commit option in source control does not work properly in Xcode

I have created an application, and I want to commit it to GitHub as as soon as I implement a new option. What I have noticed is that when I use the commit option under source control in Xcode, some ...
user1680944's user avatar
8 votes
3 answers
14k views

How to change the author of a commit in GitHub?

I want to know if there is a way to change the person(account) who pushed changes in a GitHub repository. For example: I push to my private repository under a different name(not email) but I ...
Karina Kozarova's user avatar
1 vote
4 answers
12k views

How to avoid to add the target folder into a GIT commit?

I am not so into GIT and I have a doubt. I have a project that is composed by these folders and file: $ ls bin/ lock.lck pom.xml src/ target/ I know that doing: git add . I am adding all the ...
AndreaNobili's user avatar
0 votes
0 answers
220 views

Git submodule now listed as untracked

I have a project with two submodules which I got from other people. I made modifications in both, but only one gets reported as modified and can therefore be staged for committing. The other one is in ...
Charles's user avatar
  • 1,096
0 votes
2 answers
111 views

Recovering from accidental git commit -a after patch add (git add -p)

Earlier today I was in the process of splitting a large git commit into several smaller commits and so as usual I created a new branch, did a git reset HEAD^, and proceeded with git add -p to ...
Michael Percy's user avatar
0 votes
2 answers
88 views

Hot fix between two remote git repositories

I have two git remote repositories, one is for test and the other is for production. git remote -v production https://[email protected]/deploy/pr1.git (fetch) production ...
Perez Sebastián's user avatar
0 votes
0 answers
139 views

How to prevent git push - only verified emails can be pushed

In GITHUB. How can I prevent unverified emails from pushing changes into the repository? sometimes code can be pushed even if user.email is not set. how to prevent this?
Sibiraj's user avatar
  • 4,666
1 vote
1 answer
764 views

Upload files to Gitlab, but show as subproject

I tried to upload a folder the_one_simulator to Gitlab, but the folder is uploaded as a subproject, as shown below. the_one_simulator was originally a repository in Bitbucket. I just copied it into ...
SparkAndShine's user avatar
3 votes
5 answers
39k views

What is exactly meaning of commit command in git

commit is A commit, or "revision", is an individual change to a file (or set of files). It's like when you save a file, except with Git, every time you save it creates a unique ID (a.k.a. the "...
Pratik pound's user avatar
0 votes
3 answers
73 views

Delete git commit completely in local and remote repo shared by other hundred developers

Here is the situation: A newbie developer has commited and pushed sensible credentials to remote dev branch, which is strictly forbidden This forbidden commit then got merged into the master branch ...
nhle's user avatar
  • 57
0 votes
1 answer
110 views

How to get a specific commit of a particular folder from a git repository while keeping rest of the folders as latest?

Following is the exact scenario in my repository: Folders: Respository Project A Project B Developers are working on both the projects. After a while, we realized that we the developers have ...
Nirman's user avatar
  • 6,753
0 votes
1 answer
68 views

Strange thing during committing changes with git

So, I am on elementary os. I type git commit. Sublime text opens up with 1st line empty rest lines starting with # i.e. comments telling me what to do.I type my message. I save the file. I exit the ...
Ishan Srivastava's user avatar
0 votes
1 answer
20 views

Pulling a Git repository brings different files

We are working in a project which code is hosted in Github. At some point the main branch master had to be rolled back to a certain commit. We did that by locally rolling back to the commit, then ...
Pablo Viacheslav's user avatar
1 vote
1 answer
204 views

Git: Weird phenomenon in commit conflict

I'm new to the git world and here is a very weird commit conflict problem which is happening to me all the time. I use git through eclipse. It is pretty weird so I try to explain it simply. Here is ...
Luke_Z's user avatar
  • 11
0 votes
1 answer
669 views

Roll back both on local branch and master branch?

How can I roll back to the last commit both local branch and master branch? $ git reset --hard HEAD^ HEAD is now at e861a3e Added push menu label. $ git status On branch master Your branch is behind ...
Run's user avatar
  • 56.1k
1 vote
1 answer
123 views

Unintended commit by Git

I committed a java file using git commit -a I forgot to add a file to said commit so I tried to amend the previous one using git commit -a --amend When the editor opened up, I changed my mind and ...
TheCoder's user avatar
  • 8,713

1
23 24
25
26 27
44