Git to a Web-server : How To Set remote git server to automatically merge the branch after pushing?

First of all, im new to Git and Git hooks. Here's what im trying to do... I want to create a local git repository where I'll work on my website. Then, I want to setup a git repository in my webserver and push the changes directly from my machine to the server using git. For this, what is the best path?

  • I followed some online guides and did this...
  • Initiated a repository on the remote server.
  • Initiated a repository on my local machine
  • Made a commit
  • Switched to a different branch (Can't push the master branch to the server (If I can, its a lot easy))
  • Pushed that branch to the server
  • Logged into the server and merged the branch into the master from within it

My questions are, Is this the best way to do the job? If it is, can I do the merging part using hooks automatically? (How to do it? Im new to hooks)

Answers


Reading your question and the comment - the problem is with the way you initialized the repository on your server.

On your server you need to initialize a bare repository, using the following command:

git init --bare

That will fix the error you got when pushing to the server.


Need Your Help

Creating a circle out of tiles

java circle tiles sin cos

This is my first attempt at creating a 2D game, so my code probably isn't as efficient as it could be. Anyway, I tried creating a method to create circles out of my tiles. The point of this method ...

Is Full Outer Join Not Supported in Microsoft.Jet.OLEDB.4.0?

sql outer-join oledbdataadapter

I am querying a Dbf file and I want to full join two query in C# console application. But It seems that Full Join is not supported in Microsoft.jet.oledb.4.0. I get the Following error when I run the

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.