I am trying to setup git for automatic deployment. Here is what I am doing..
- I have created one empty bare repository on my repos server which hosted on xyz.com.
- Then in eclipse using EGit I have clone newly created bare repository.
- On my local machine I have one php project.
- Now I want to create 3 branches development, staging, production and want to add my project to development branch.
Maybe I am doing something wrong or missed something to setup. Can anyone please guide me for git setup?
All help would be appreciated.
To create the 3 branches, you can do the following (using whatever names you prefer) from the git command line:
To add your project to the dev branch, copy your project files into the git working directory on your filesystem – this will be the directory that contains the ‘.git’ directory (i.e. not the ‘.git’ directory itself).
Then from the command line run:
which should give you a list of the files that you copied – they will be under the heading ‘Untracked files:’.
Now run the following commands to add them to the dev branch (replacing “MyCommitMessage” with an appropriate commit message):
At this point you can use
to synchronise the remote bare repository with what you have locally.