I have a Git repository. I have cloned the repository,Commited my local changes. When I push my changes to the server it shows error - tortoisegit

when i pull the chages from clone, it is reflected in server and vice versa. but when i push it shows error.
Error message:
git.exe push --progress "origin" master:master
Counting objects: 11, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 474 bytes | 0 bytes/s, done.
Total 6 (delta 3), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To //INCHNLRDFS06/CUB Ebanking$/GIT_Ebank
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '//INCHNLRDFS06/CUB Ebanking$/GIT_Ebank'
git did not exit cleanly (exit code 1) (1029 ms # 9/10/2014 6:43:09 PM)

If you are cloning from another user's repository, the origin remote (assuming you're pushing to origin) is linked to that user's repo.
In order to commit and push your changes, you first must fork that user's repo and clone from your fork. Doing so will set up your remote to your repo and you can commit and push as you please.
You can view your remotes in the .git/config file and correct them if you're still having trouble.

Related

Cannot push git error: hook declined with remote ruby error

One day, I suddenly just cannot push to one of res (While pulling is fine). This is the error log
Writing objects: 100% (42/42), 11.23 KiB | 0 bytes/s, done.
Total 42 (delta 34), reused 0 (delta 0)
remote: /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/shared_helpers.rb:2:in `require':
no such file to load-- rubygems (LoadError)
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/shared_helpers.rb:2
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/setup.rb:1:in `require'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/setup.rb:1
remote: error: hook declined to update refs/heads/master
To http://192.168.1.140:8000/chnn/application2.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'http://192.168.1.140:8000/chnn/application2.git'
I can also create a new project and push it to gitlab just fine. Only 1 project has this problem
Ask your git repo admin with this error. It is custom git hook (mean git plugin) crash.
Okay. So in my particular case, no problem is found within the server. We were desperate and tried to push over ssh rather than http and then bam, it works again.
In the end, we do not know why and how. The question still remains:
Why we can push normally over http if create new projects
Why other
do not have this problem

cant git push heroku master - buildpacks

well simply this is what i am getting;
sa#sa-VPCW11S1E:/opt/hubot/bin$ heroku buildpacks
=== young-everglades-12415 Buildpack URL
heroku/java
sa#sa-VPCW11S1E:/opt/hubot/bin$ sudo git push heroku master
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 2.14 KiB | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Failed to detect set buildpack https://codon- buildpacks.s3.amazonaws.com/buildpacks/heroku/java.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to young-everglades-12415.
remote:
To https://git.heroku.com/young-everglades-12415.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/young- everglades-12415.git'
sa#sa-VPCW11S1E:/opt/hubot/bin$
although i did set a buildpack on the app git push failed because no buildpack detected ?
How can i resolve this, and is it actually the right steps towards deploying hubot ?
The heroku build packs still use the detection script to identify the language in use. Since Hubot is not a java project and it looks like you are using the java build pack, I suspect the detection script failed.
To fix this, try removing the buildpack.
% heroku buildpacks:remove heroku/java
After this I would try,
% git push heroku master
(Optional) I believe the rediscloud addon is needed for some scripts. You can add it with,
% heroku addons:create rediscloud
Then watch the logs heroku logs and see what happens.
There is a good deployment guide in hubot/deploying/heroku.md

Fail to deploy to Heroku: Argument list too long - bin/receive_untrusted

When I try to update my Java app on Heroku it fails with a "Argument list too long - bin/receive_untrusted". This happens before the actual build process starts and it's the only error that I'm getting. Of course it build perfect locally..
Counting objects: 95506, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (28630/28630), done.
Writing objects: 100% (95506/95506), 16.95 MiB | 2.82 MiB/s, done.
Total 95506 (delta 42943), reused 94815 (delta 42643)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: Build stream timed out, reverting to polling...
remote:
remote: Build output:
remote: Argument list too long - bin/receive_untrusted
remote: ! Push rejected to xxxxx.
remote:
To https://git.heroku.com/xxxx.git
! [remote rejected] develop -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/xxxxx.git'
The only thing that fixed it for me was resetting the Git repo in Heroku and pushing it from scratch, a described in this answer.

GitHub for Mac throw a Git Error when I clicked the Publish button

Like the Title, it throw me a Git Error message:
2013-06-08 13:51:35.249 GitHub for Mac Login[1883:707] AskPass with
arguments: (
"/Applications/GitHub.app/Contents/MacOS/GitHub for Mac Login",
"root#192.168.1.107's password: " )
2013-06-08 13:51:35.285 GitHub for Mac Login[1883:707] Error reading
attributes for password: OSStatus 840183217
Counting objects: 3, done.
Writing objects: 33% (1/3)
Writing objects: 66% (2/3)
Writing objects: 100% (3/3)
Writing objects: 100% (3/3), 215 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To root#192.168.1.107:/var/www/html/repository/ ! [remote rejected]
master -> master (branch is currently checked out) error: failed to
push some refs to 'root#192.168.1.107:/var/www/html/repository/' (1)
I'm a beginner of use git to control the program version, and I find something like GitHub for Mac to use easily.
What I should be in the linux server configuration?
I find some useful from
http://rogerdudler.github.io/git-guide/
How to publish files to my server?
Thank you!
The error message says that you are trying to push to a non-bare repository, i.e. a normal repository rather than one that was created (with git init --bare) to enable it to function easily as a "central" repository that can be pushed to.
If you want more guidance on how to get started with git, take a look at the question
Git for beginners: The definitive practical guide

git push heroku master error

I'm encountering a problem deploying heroku. The online instructions suggest I follow these steps: https://devcenter.heroku.com/articles/django#deploy-to-heroku
However, when I get to "git push heroku master" I get the following error:
Counting objects: 12, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (12/12), 3.44 KiB, done.
Total 12 (delta 1), reused 0 (delta 0)
! Heroku push rejected, no Cedar-supported app detected
To git#heroku.com:mysterious-peak-4781.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:mysterious-peak-4781.git'
Can someone tell me whats wrong?
Rename the app as soon as you create it. It is a must in heroku i guess.
use this command
heroku apps:rename NAME
NAME = what ever name you want to put.
If the above does not work,
type
cd .git
vi config
you will get something like this.
[remote "heroku"]
url = git#heroku.com:NAME.git
This is also a method. Change the name and try.

Resources