开发者

How do I create a Git workflow from my existing project on a web host to Github?

开发者 https://www.devze.com 2023-02-28 13:09 出处:网络
I\'m new to the Git world but I realize that, since my programmer and I are going to be working on files at the same time, we need to establish a Git workflow. I have very minimal experience with Git

I'm new to the Git world but I realize that, since my programmer and I are going to be working on files at the same time, we need to establish a Git workflow. I have very minimal experience with Git from a 3 month project I did last year so I need help setting 开发者_JAVA技巧this up.

Currently, I have an account at a web host where all the current project files exist. I typically modify the files remotely using Coda connected to the server.

We purchased a month of service at Github to create a private repository so that we can use the GUI feedback of Github to solve bugs using the pretty UI to see the diffs.

On the web host account, no Git repository is setup yet. I do not completely understand how to transfer the files to Github but I assume I would need to create a repository on the web host account first and then push this to the Github account.

Does this sound correct? Which account would we set as the master repository? Beyond what I wrote, I am not sure I completely understand how to do every or if there's a better way to do what I've explained.

I'd appreciate your feedback and if possible someone to write explicit instructions on how to do this. Thanks!


When working with GitHub repo, you have two choices:

  • add your team as collaborator for your repo (they can push directly to said repo)
  • ask them to fork your repo (clone on the GitHub side), then making pull requests in order for you to integrate their changes.

Since we are talking private repo, the first solution is more practical (to avoid having to setup different private, i.e. not free, repos for each developers).

From there you need to setup a branch/merge workflow decide if you want, for a given development effort where several people work on the same set of files, if:

  • each developers will work on the same common branch (in which case they need to rebase and resolve any conflict locally, before pushing their commits)
  • each developers will work on a user-specific branch (in which case, they can push whenever they want, but an integrator will have to pull said branches and do the merge).

(see also "when should you branch?" and the second part of "Why uses git fast-forward merging per default?")


Here's a great guide on github:

http://help.github.com/create-a-repo/

I'd download the content from the web host first, so you have everything locally, and then push up to github.

0

精彩评论

暂无评论...
验证码 换一张
取 消