Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Add Remote with Git Gui?

Tags:

git

git-gui

I want to push my changes to a folder on a remote server. I can even do a map drive to it. Wish there was a folder browser (the same as choosing where to create repo) where I can select the server folder I want to push to. Since there isn't I know I have a syntax error here.

enter image description here

like image 943
isurfbecause Avatar asked Jul 16 '12 16:07

isurfbecause


1 Answers

Adding a remote has nothing to do with the physical remote itself. It is only for management of references to remotes themselves.

That being said, it sounds like you want to use Git to deploy to a server. You can use pushing of a branch to attain this. However, you first must have the remote setup via running this on the server

git clone --bare //path/to/your/repo /some/dir/on/the/server/.git

Now you must add a hook to this repo to fire every time you push to a branch. Within this hook you would:

git --git-dir=/some/dir/on/the/server/.git --work-tree=/where/to/deploy/to checkout deployment-branch -- .

You'll have to google git update hook to get the few lines of code needed to wrap the above line.

like image 95
Adam Dymitruk Avatar answered Oct 18 '22 03:10

Adam Dymitruk