git (via cygwin)
$ git --version
git version 1.6.0.4
$ git push origin master
Counting objects: 6669, done.
Compressing objects: 100% (6570/6570), done.
Writing objects: 100% (6669/6669), 7.90 MiB | 348 KiB/s, done.
Total 6669 (delta 4488), reused 0 (delta 0)
*** Project description file hasn't been set
error: hooks/update exited with error code 1
error: hook declined to update refs/heads/master
To /cygdrive/e/westpac/compass.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to '/cygdrive/e/project.git'
The above problem is caused by a hook script (.git/hooks/update).
Rename update to something like update.bak so it does not get executed solves the above problem.
$ git --version
git version 1.6.0.4
On USB key
mkdir project.init and cd into it
git --bare init
In project codebase's directory
git init
git add .
git ci -m'first commit'
git remote add origin /path/to/project.git
git push origin master
Modify you local master to track remote by appending the following to your project's .git/config file:
Gotchas when using git on cygwinmkdir project.init and cd into it
git --bare init
In project codebase's directory
git init
git add .
git ci -m'first commit'
git remote add origin /path/to/project.git
git push origin master
Modify you local master to track remote by appending the following to your project's .git/config file:
[branch "master"]
remote = origin
merge = refs/heads/master
Then you can just do the following in the future to push new files to your USB.
git add .
git ci -m'update repos'
git push
$ git push origin master
Counting objects: 6669, done.
Compressing objects: 100% (6570/6570), done.
Writing objects: 100% (6669/6669), 7.90 MiB | 348 KiB/s, done.
Total 6669 (delta 4488), reused 0 (delta 0)
*** Project description file hasn't been set
error: hooks/update exited with error code 1
error: hook declined to update refs/heads/master
To /cygdrive/e/westpac/compass.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to '/cygdrive/e/project.git'
The above problem is caused by a hook script (.git/hooks/update).
Rename update to something like update.bak so it does not get executed solves the above problem.
p.s. with the newer version of cygwin git the hook scripts are all suffixed with .sample in the file name, which means they don't get executed hence won't have the above problem.
1 comment:
In fact, the "update" script in the hook directory verify if the user has changed the "description" file of the parent directory.
Editing the file "description" resolve the problem in a better
manner.
Remove the first line which is a default description of a Git project, and put your own description, now your problem should be solved, without renaming the update file.
Post a Comment