NLi10Me
NLi10Me

Reputation: 3302

learning git, combining two project directories

I have a basic git question.

I have been developing a project for the past 18 months or so. There are two copies of the project, one on my own machine and one on my laboratory server. Until now, I've just been managing updates made in one copy by manually updating the other copy. This has now gotten out of hand/difficult to keep track of which copy is the most up to date, so I want to start using proper version control.

I have downloaded and installed git. I have created a repository for the project on bitbucket. I have created a repository for the project locally on my own machine and added all the current files to it. I have added the bitbucket repository as the local copies origin. I have committed and pushed the local copy to bitbucket, which was successful.

So, here's the question. I now need to add the server copy of the project somehow. I am totally new to git and bitbucket.

Do I just proceed as I did for the local copy? That is, in the server project directory, create a new repository, add all the files to it, set the bitbucket copy as the origin, commit and push? Will this reconcile any differences between the current server version and the (already pushed) local copy?

Thanks for your time!

Upvotes: 0

Views: 36

Answers (1)

Jean Waghetti
Jean Waghetti

Reputation: 4727

Yes, you can do that. But with only one difference:

  • Create the new repo, add all files and commit.

  • Set BitBucket as the origin.

  • Pull (bring changes of BitBucket to local repository).

  • Resolve any merge conflicts.

  • Push.

Upvotes: 1

Related Questions