Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8971795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:03:01+00:00 2026-06-15T18:03:01+00:00

I am trying to setup git for automatic deployment. Here is what I am

  • 0

I am trying to setup git for automatic deployment. Here is what I am doing..

  1. I have created one empty bare repository on my repos server which hosted on xyz.com.
  2. Then in eclipse using EGit I have clone newly created bare repository.
  3. On my local machine I have one php project.
  4. 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:03:02+00:00Added an answer on June 15, 2026 at 6:03 pm

    To create the 3 branches, you can do the following (using whatever names you prefer) from the git command line:

    git checkout -b prod
    git checkout -b stage
    git checkout -b dev
    

    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:

    git status
    

    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):

    git add .
    git commit -m "MyCommitMessage"
    

    At this point you can use

    git push --all
    

    to synchronise the remote bare repository with what you have locally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've setup a git repository one a remote server. Now I'm trying to checkout
We are trying to setup an automated deployment environemt with Git/Github. We have 3
I am trying to implement the setup outlined here http://toroid.org/ams/git-website-howto but with one difference.
I have a user 'git' that owns a git repository. I'm trying to setup
So, reading http://git-scm.com/book/en/v1/Git-on-the-Server-Public-Access , I'm trying to setup a bare repo as instructed on
I have been trying to setup git for our web development team unsuccessfully. Some
Hello I am new to Git and trying to setup server part and client
We have two Git repos on a remote git server in this format: /git/repo1
I am trying to setup a shared git repository via ssh, copying users public
I have gitosis setup on my server and I'm trying to create a post-receive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.