Questions tagged [git-commit]
git-commit - Record changes to the repository along with a log message.
1,917
questions
0
votes
0
answers
21
views
Error in committing rubyonrails code in Github
I tried committing my Ruby on Rails code from Github desktop, and I got the below
error, please help me how to resolve this error and commit my code?
.git/hooks/commit-msg:167:in `validate': undefined ...
1
vote
0
answers
17
views
How to disable Git-commit with specific packages and files inside AndroidStudio?
The Problem
I had a lot of files autogenerated by Android studio after I build the project, so when I try to commit the project, the commit section is full of files I didn't want to commit or push to ...
-1
votes
1
answer
69
views
"pre-commit" command is not found by bash but is installed on macOS
Problem Description
I'm having trouble making commits, when I try to make a commit with the command, for example:
git commit -m "add readme" the error with the following message appears:
&...
0
votes
2
answers
83
views
Splitting changes into 2 commits for git
I have a master branch on git. Using EGit on Eclipse, I have downloaded on my local repo and I have made some changes on many files.
I have already made a huge chunk of changes on many tracked files ...
1
vote
2
answers
24
views
i lost my readme file because i did 'git push --force' in local but I don't know how to get it back. The readme file was created in remote
I lost my readme file because I did
git push -f origin main
in local. But I don't know how to get it back.
I found this solution
git reset before-commit
git push -f origin main
The readme file was ...
-1
votes
1
answer
26
views
Sourcetree commit description
How can I write a description to my commit message through the client? I’ve been searching around for this but not find anything.
My goal is to have something like:
This I my commit message.
And this ...
0
votes
2
answers
51
views
How to sync git repos when two people are working on them and changing the commit history simultaneously?
I am currently working on reordering, squashing and changing some stuff in a git branch which has a lot of pending commits (currently around 300) that needs to be merged.
I am facing difficulties ...
0
votes
1
answer
24
views
How Can I git squash commit after PR completed?
In our projects, We use policy squash merge for merging and release our project when merge release branch to master branch. one of my co-worker use no fast-forward merge and put all develop's history ...
2
votes
1
answer
27
views
Remove old commit preserving changes
I started editing a project downloaded from a glitch repository I played around for a little bit. A lot of automatic commits were done before I downloaded the project and continued editing it locally. ...
0
votes
1
answer
20
views
How could I find out the old file name in Azure DevOps?
I moved a file one folder up. Now in Azure DevOps in commit content I see [rename] written next to the file, but I do not see how the file name was changed (i.e. I do not see the old file name). Is ...
0
votes
0
answers
13
views
I pushed a commit in the master branch. I want to UNDO it. How I can do that? [duplicate]
By mistake, I modified the code in the master branch and pushed it. I want to undo this commit. How can I do this?
0
votes
1
answer
45
views
Git GPG Signing Bad Signature
I am trying to enable gpg commit signing on my mac. I have successfully signed one commit and then tried to do it again and ever since I can't get it to work properly again.
Every time it says Bad ...
-1
votes
0
answers
25
views
I can't commit to my git as I always receive this notification, Git: cannot spawn C:\Program Files (x86)\GnuPG\bin\gpg.exe: No such file or directory
I am a newbie in coding and is using vscode but I can't commit my code to github. When I first tried commiting my code, I received a notification that says, "gpg:no skipped:no secret key windows&...
0
votes
1
answer
39
views
gpg skipped KEY No secret key error message when trying to sign a git commit on Windows 10
I followed instructions here: https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key
I did not include a comment. Only my name and email which match ...
-1
votes
0
answers
19
views
Default Merge Commit message templates for all projects in group
Is there a way to make a default merge commit message in all projects including the newly created ones in a group instead of manually changing it per project?
I want my default merge commit message to ...
0
votes
1
answer
33
views
"commit or discard the untracked or modified content in submodules"
Since this morning I have a problem for committing my work :
I tried several commands to clean up my local repo but I still have the same problem, I have searched well in other topics where the ...
0
votes
0
answers
15
views
What should be the first commit message using commitlint?
If I am using @commitlint/config-conventional, what should be my first commit message using commmitlint? Is it feat: first commit or a build: first commit or a chore: first commit?
-1
votes
2
answers
54
views
Forgot to commit the changes in git after adding them and directly pushed into the branch
I mistakely pushed the changes in a branch instead of committing them. I noticed that it was pushed successfully( git doesnot give any error message if we forget to commit). Now I do not get those ...
1
vote
2
answers
48
views
Will git pull command overwrite non-commit changes
Git pull command will fetch + merge remote branch to local branch . And if there are merge conflict between commits , you can resolves it locally .
But what if I never commit anything I changed ...
0
votes
1
answer
29
views
Git rebase --onto squashed branch
I need some help on how to use git rebase --onto to rebase a working branch effectively. I tried to follow this doc https://womanonrails.com/git-rebase-onto
Context
I branched branch-B from branch-A. ...
-1
votes
1
answer
26
views
Git pushing old commits from deleted files
I keep trying to push a brand new repository and a brand new branch. When I do so, it pushes files and commits from weeks ago. These files were deleted a while ago. There's absolutely nothing in my ...
0
votes
0
answers
10
views
Cannot purge commit in a GitHub blob using BFG
I am trying to purge credentials in a file on an Enterprise GitHub repository by following the BFG instructions on a GH article.
I had first used BFG to remove the credentials using a regular (non-...
-1
votes
0
answers
23
views
Prow job local commit reference is not a tree
I am supposed to debug an issue where prowjob have issue checking out to a specific commit f74e42a
prow script:
git init
git remote add origin <upstream repo>.git
if [ -z "$branch" ]; ...
0
votes
1
answer
38
views
GIT diff command working in powerShell with different options
I am new to GIT commands and having tough time with it :(.
My requirement is to use GIT command in PowerShell and do some logic.
How to combine GIT diff with commitID and folder path?
This works-
>$...
0
votes
0
answers
13
views
How do I remove directories from an initial commit: push to GitHub fails
I want to put a legacy code of mine on GitHub. In a foolish move, I selected the whole project (in PyCharm) to add to the initial commit; I forgot that this includes data and plot directories that are ...
0
votes
1
answer
37
views
git: get commits in order for changelog
I am working on git following gitflow (with feature branches and hotfix).
Each commit is as follows " [ticket ID]: message "
With jenkins I would like to generate a changelog between 2 tags, ...
1
vote
1
answer
26
views
How to make git always warn to stash or commit changes before checking out a different branch?
When I have modified my current branch and check out to a different branch, git warns me that I have not stashed or commited fails only when there is a conflict between the two branches.
How can I ...
-1
votes
1
answer
22
views
How do I prevent git from timing out when pushing huge amounts of data?
Is there a way to push huge amounts of data to github? I have a massive collection of files I am trying to backup, but when I try to push them, git will timeout or stop working in the middle of it.
...
0
votes
1
answer
37
views
Intellij stopped auto staging, files no longer highlighted green after changes
Previously working with Intellij it was highlighting files green, that I have changed but not committed yet. Now when I change they are not being highlighted, when try to git commit -m message in ...
1
vote
1
answer
49
views
Git Workflow - Correct early errors
Let's say I have a branch Master With the following commits:
M1->M2
Then from M2 a branch Feature is created and developed as:
M2->F1->F2->F3->F4
Then a merge request is created from ...
2
votes
1
answer
72
views
Remove a number of files from old commits on specific remote branch of git repo (without having to push to master branch)
I work with a code base shared by a number of people and have a particular branch that is for my personal use only. I made a huge mistake and about 10 commits ago removed a particular file type from ...
0
votes
1
answer
37
views
Is it possible to make someone a co-author on a past commit already pushed to GitHub?
The title summarizes it perfectly. I have a couple commits on the main GitHub branch that I would like to add a co-author too. I tried using git --amend and adding the email and name to the commit in ...
0
votes
0
answers
35
views
PyGithub - Way to get tags associated with a GutHub commit
I want to get a list of all the tags associated with a GitHub commit. I'm using the PyGithub library and calling repository.get_commits() which returns a list of commits. I now want access to each ...
-1
votes
2
answers
47
views
How can I check if a commit exists in a pull request on GitHub?
So I have a list of commits SHAs to check. In a given commit SHA let's say 123ab45, I want to see if the commit is linked to a PR in the branch.
Is there any command that I can put to check that?
0
votes
2
answers
30
views
In a given repo, output the differences between two commits
When I want to see the output of the gif difference between given two commits SHAs (let's say 123ab45 and 678cd90), I use this
git diff 123ab45 678cd90
But when the two commits that sit in a different ...
0
votes
1
answer
12
views
How to configure submodule remote and push
I have a third party repo as a submodule sub living in parent/data/.
In parent/data/sub/, git status gives me
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
# (use "...
0
votes
0
answers
44
views
How to commit a file to Bitbucket using Rest API?
I am trying to commit a file to Bitbucket using Rest API from postman, but it shows method not allowed.
Below is the URL which I am trying
http://URL/projects/CONFIG_MNGMNT/repos/devicegroups/browse/C:...
0
votes
2
answers
26
views
Delete again a file via a previous commit that deleted that file in the first place
Scenario:
delete file.txt file, commitA and push
restore file.txt via git checkout commitA~1 file.txt , commitB and push
I want to delete the file again by invoking commitA by running the following ...
-1
votes
1
answer
54
views
How to delete all files > 1 Mb from the history (but keep them in the repository) [duplicate]
I have a repository with many big files (psd, exe, pdf, etc.) and everytime I commit an update of thoses files the git .pack file grow drastiquelly to keep the history. How can I delete all files > ...
1
vote
1
answer
38
views
couldn't commit to Github remotely
I have been trying to create a repository from VScode but couldn't therefore I had to follow Github's default way of creating and pushing commits manually. The error it throws-:
git -c user....
0
votes
0
answers
15
views
Discard local change on Git without using gitignore, checkout or reset HEAD [duplicate]
My public project (that others are going to clone and use) has a config file. Right now this config file is a template file on the remote repo, which means anyone who clones the project can easily ...
1
vote
1
answer
27
views
Git - Loosing file after renaming and branch, why?
I initialize a new repository in an empty folder:
git init
Now I copy two files A.java and B.java into this folder and commit:
git add A.java B.java && git commit -m "Added A.java and B....
1
vote
1
answer
29
views
Why github username and commit name is not the same?
I have uploaded my project on github and on the website I have different username and commit name:
Image
For this post I have changed it to "NAME 1" and "NAME 2" .
Why aren't they ...
0
votes
0
answers
26
views
How can I change all commits of another user, "X" to another user, "Y" [duplicate]
I am looking out for a way to change the commit histories on a project whereby the commit by user "X" is changed to commits made by user "Y".
Is that in any way possible?
The ...
0
votes
1
answer
18
views
Eclipse commits not showing up on Git Contributions
I am currently going trying to learn java, and my IDE is Eclipse. I connected my Github account and am easily able to push/pull etc. Everything is working great, except for the fact that my commits ...
1
vote
1
answer
194
views
How to enforce conventional commit messages in git (Bitbucket)
I'm looking for a way to prevent commits which have no correct format for the commit message.
I intend to use the following convention:
https://www.conventionalcommits.org/en/v1.0.0/
I found out ...
-1
votes
1
answer
93
views
Migration SVN to Gitlab
How can we migrate a project SVN to Gitlab ?
if we commit to SVN , will be automatically change in gitlab referenciel ?
0
votes
0
answers
30
views
How do I check if an old commit of a deleted branch that has been merged exists in develop?
Basically, I'm trying to write a script that ensures that a certain commit has been merged.
When i try to execute the command git branch --contains 0871b8479e6332ee3bd7a1ea9ea5b53795c3b3c5 in my ...
2
votes
0
answers
39
views
How to trigger a WebHook when a Public Github repo that I do not own gets a new commit?
Is it possible to trigger a webhook whenever a public Github repo gets a new commit. I tried seeing on Zapier and other automation tools, but all of them require me to be an owner of that repo.
0
votes
0
answers
36
views
Establish which version/tag a commit contributes to
In a commit based research for Software Engineering, the first task I've been asked to do is to link every commit to a version. So, per say, every commit that happened between version 1.1 to 1.2 would ...