简体   繁体   中英

Configuring a remote Git repository

I'm new to Git, but already enjoying and reaping the benefits. However, I need to move things along.

I have Git running on my Mac, and — just so you know precisely — I'm using Coda 2 and the Github client for the Mac.

I have access to a server which has two accounts: 1. live (accessible via www.domain.com), and; 2. developer (accessible via d.domain.com).

I'd like to:

  1. have the changes I'm making to a specific web application project (written in PHP, using MySQL) reflected on the developer account for the client to approve, and then;
  2. finally upload to the live account afterwards.

As it stands, after much reading of Chapter 4 of the Git documentation , I'm none the wiser.

While I'm a developer, I very rarely get involved hands-on in networking, terminals, or those kinds of things; I typically use cPanel and WHM.

So I'm looking for something simple to guide me through the process, certainly simpler than the aforementioned, which makes hardly any sense to me.

I think you need to create a local Git repo with two Remote (developer domain and live domain):

git remote add dev http://d.domain.com/path/to/repo
git remote add live http://domain.com/path/to/repo

When you want to push your master branch to dev do:

git push dev master

and if you are ready to go live:

git pull dev master
git push live master

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM