Able to commit in git but not able to push in git with ERROR: JIRA/RALLY_ID (USXXXX/DEXXXX/ESTC-XXXXX) is required in commit comment, not pushing - github

For a private project hosted in github, I am able to commit the message. I am unable to push the changes to remote. I get the following error. I have also tried with the command git commit --amend -m "JiraId: Msg" and after that I tried with the command git push --force. Still I always get the same below error message.
> remote: INFO: Checking commit message ...... remote: ERROR:
> JIRA/RALLY_ID (USXXXX/DEXXXX/ESTC-XXXXX) is required in commit
> comment, not pushing remote: TIPS: run git commit --amend to update
> commit comment and push again

It looks like a pre-receive server-side hook, which enforces you to use related issue key from Jira in the commit message, prior to pushing.
Jira is an issue tracker, and i'm assuming the work you are trying to push is described in a related issue (story, task...) in a Jira project.
Acceptable issue key format is: (USXXXX/DEXXXX/ESTC-XXXXX)
It may be one-of the above: US1234 or ESTC-9876
Or all as one: US1234/DEX5678/ESTC-3344
May/not include parentheses - (US1234) or (US1234/DEX5678/ESTC-3344)
You probably need to update the commit message with the actual issue key before be able to push it successfully to remote.
Try to asking org/repo admins about it.
Give it a try if you have actual related issue keys.

Related

Changes not staged to commit

message from terminal
I get this message and i don't know what to do next, i was trying to upload my projects in github without success.
i did this commands:
commands i typed
now i am stuck with Changes not staged and i want that message to be removed as u can see in my commands i tried everything, please help.
From the message in your terminal, you first need to commit changes before pushing it to Github (or reset your changes if you don't want to push it):
Add and commit changes:
git add .
git commit -m "<place your commit message here>"
git push ...

EGIT Can't connect to any repository - Missing unknown

I just created a new repository on GitHub and trying to initially push my local Java project.
I added the ssh key in my GitHub account, and it's referenced correctly by Eclipse, I assume.
I only get this error message when I'm trying to push:
Can't connect to any repository:
git#github.com:MaximStein/MyProject.git
(git#github.com:MaximStein/MyProject.git: Missing unknown
366362as232d670123a2267b4879bbd01d142426)
Any ideas?
Your Git repository seems to be broken or at least in an invalid state.
The root cause seems to be Missing unknown 366362as232d670123a2267b4879bbd01d142426 which means something (probably the HEAD) points to the object with the hash 366362as232d670123a2267b4879bbd01d142426 (which will be stored in the file .git/objects/36/6362as232d670123a2267b4879bbd01d142426) that does not exist.
In the Git History you might right-click the last commit and choose Reset > Soft (HEAD Only). If commits are missing, you might be able to recover them via the Git Reflog view.
Make also sure your Eclipse and EGit/JGit is up to date (for instance, there was an issue causing a Missing unknown error that has been fixed more than four years ago) and that you do a refresh (F5) in Eclipse after you have executed Git operations on the command line.
Try first if the push would succeed from command line (which means you need in to install Git first):
check you are correctly identified with ssh -Tv git#github.com
check your remote origin URL: git remote -v
check your local status (git status: to make sure you are on a branch, here I assume main, and that you have made at least one commit)
check your initial push: git push -u origin main
Check also if you have declared any submodules (.gitmodules file), or look for any nested Git repository (.git subfolder anywhere beside your repository root folder)
It is helpful to rule out (or not) a git-core issue, before investigation an Egit/JGit one.
And the OP Maxim confirms in the comments:
It's a good idea to try it in the command line first.
It says "fatal: bad object HEAD" when I do git status.
I think I've only made one local commit for that project.
Indeed, making local commits, in a branch, is a prerequisite to pushing anything.
In your case, do a git branch -avv to check if there are any.
If you already pushed that missing commit, assuming your main branch is main (not master):
git fetch origin
git reset --soft origin/main

Can't to push commits from local branch to github repository

I was committing and pushing in ordinary for my repository.
but once i used command of git checkout for change to the previous version of my repository.
after that i tried to commit and push, then it can not completed.
i try to use the --no-verify command to push the commit but it also not success.
error: failed to push some refs to 'https://github.com/ruwanliyanage123/Hair-4-U-Hospital.git'
i want to push my commit into github repository
Since you switched to a previous version of your repository, your head is most probably detached. You can't just go back anywhere in your history and make commits.
Consider making a branch from there and then commit to it.
Try to first check in which branch you are working do git branch, check is the one you are working. Then I sometimes do git pull to just make sure that the connection is working this should not delete your progress the you should be able to do git push. If you are afraid youll mess up first do a local back up of all project files except for the .git one which are hidden by default in windows.Lastly I would suggest never posting the actual link to your github repository in case whatever you are working is important, you can just replace with
https://github.com/user/projectname.git

Cannot submit a pull request in angular/angular

I discovered a minor bug in Angular's code, opened an issue on GitHub ( https://github.com/angular/angular/issues/19078 ) and now I am asked to submit a pull request but I'm not a "git pro" and however I try it doesn't work out.
What I did:
I read the guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-submitting-a-pull-request-pr
signed Google's CLA.
cloned the repo using: git clone https://github.com/angular/angular.git (was it necessary?)
edited the buggy file. (but without having the files, this step wouldn't have been possible, right?)
made my changes in a new git branch: git checkout -b my-fix-branch master
commited my changes: git commit -a
VIM opened, I put in a message, closed the editor.
commit seemed to be successful because in the terminal I see: [my-fix-branch 24f1f306e] docs typo fix 1 file changed, 1 insertion(+), 1 deletion(-)
tried to push it: git push origin my-fix-branch
typed in my GitHub credentials.
And now I face the error message: remote: Permission to angular/angular.git denied to swirlsky.
fatal: unable to access 'https://github.com/angular/angular.git/': The requested URL returned error: 403
First I should complete this, and only after that I should open a pull request on GitHub, otherwise how could they know what changes I made in the code, right? ...and for that, will this one be the appropriate page: https://github.com/angular/angular/compare/master...4.4.x ?
You have to fork angular using the fork button on the top right corner
You will have a new repo at yourusername/angular, work and push on it.
Then, you'll be able to submit a pull request

Unexpected system error after push was received

There was some github.com down time today that I wasn't aware of until I went to push about one dozen local commits.
https://status.github.com/messages
https://twitter.com/githubstatus
Here's the message I received when trying to push to github.com:
remote: Unexpected system error after push was received.
remote: These changes may not be reflected on github.com!
remote: Your unique error code: abcdefghijklmnopqrstuvwxuz
Now that github.com is back up, when I view the project commit history online, I can see these dozen commits have not been pushed up to the repo.
I figured I could just push these changes again with git push origin master, but I am told Everything up-to-date. Similarily a git pull origin master also shows Everything up-to-date.
How can I get these local changes pushed up to my repo on github.com?
I hate to answer my own question so quickly, but with a little tinkering, here's a quick work around I discovered:
echo "bar" >> foo.txt
git add foo.txt
git commit -m "Add foo.txt"
git push origin master
git rm foo.txt
git commit -m "Remove foo.txt"
git push origin master
This properly refreshed the commit history for my github.com repo. This should be safe to do, but definitely take a backup of your local code before trying it.
I agree with Yen Chi, he should have made this an answer. At the least, do an empty commit:
git commit --allow-empty
Pushing another commit for me didn't work.
Instead, creating a dummy branch, from the web interface, solved the problem.
I just had this too, and yes, pushing another commit fixed the problem.
I think that the source of the problem may be that I was pulling from the same repo at the same time (I use submodules). That pull yielded everything up to date, while the first push was still hanging (and then eventually spitting out that error message).
git commit --amend
git push -f origin HEAD
or if you don't like that
git commit --allow-empty
git push origin HEAD