So I'm using GIT, trying to push code to my remote server.
to get things working, I had to use to following clone command :
git clone -u /home/bin/git-upload-pack [email protected]:mygitfolder
same versions of git on local machine/remote server (1.7.0.4)
so from what I can gather, I need to basically :
I understand I could create a hook that would take effect as I push, but have not managed to find where/how this is implemented.
(I would rather not create an alias on my local machine)
In order to push a Git branch to remote, you need to execute the “git push” command and specify the remote as well as the branch name to be pushed. If you are not already on the branch that you want to push, you can execute the “git checkout” command to switch to your branch.
Description. Invoked by git fetch-pack, learns what objects the other side is missing, and sends them after packing. This command is usually not invoked directly by the end user.
The git remote add command will create a new connection record to a remote repository. After adding a remote, you'll be able to use as a convenient shortcut for in other Git commands. For more information on the accepted URL syntax, view the "Repository URLs" section below.
The “… does not a appear to be a git repository” error is triggered when you try to clone, or run other commands, in a directory that is not recognized as a Git repository. The directory or remote file path might not have initialized Git, or the file path you are trying to access as an active repository is incorrect.
If you can not adjust the effective PATH on the remote side1, then you will have to specify the location of the programs from your local side.
As you found, git clone
can be given -u /path/to/git-upload-pack
(or --upload-pack /path/to/git-upload-pack
).
git fetch
and git pull
accept --upload-pack /path/to/git-upload-pack
(not -u
, however, since it means something else to these programs). They also check the remote.<name>.uploadpack
configuration variable.
git push
accepts --receive-pack /path/to/git-receive-pack
and checks the remote.<name>.receivepack
configuration variable.
Once you have your repository cloned, you can use the configuration variables to record the paths:
git clone -u /home/bin/git-upload-pack [email protected]:mygitfolder
cd mygitfolder
git config remote.origin.uploadpack /home/bin/git-upload-pack
git config remote.origin.receivepack /home/bin/git-receive-pack
Then you can push, fetch, or pull without having to specify the path.
1
You said that “environment variables [are] blocked for SSH accounts”. If you mean that the sshd has its PermitUserEnvironment
setting turned off (meaning that you can not use environment="PATH=/home/bin:/usr/bin:/bin"
in your .ssh/authorized_keys
file), then you still might be able to modify your default PATH via a shell initialization file (e.g. .bashrc
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With