Reputation: 25
I am new to version control such as git so this may be an easy answer for some... for all my searching I can't find a simple enough answer.
I am developing a wordpress site on a dev server. Another developer is making changes to the live (production) site and some changes are also ftp'ed to the dev site.
Is there a way for me to merge those changes to my local copy so I don't override his changes and he doesn't override mine?
I would hate to push a file to the live site that doesn't have his changes and screw the live site up...
Upvotes: 1
Views: 79
Reputation: 9634
You need to do a git pull
before trying to push your changes to the remote.
It's always a good practice to get hold of the latest master
branch (assuming that's used on your dev server) before you
Ideally, before you start working on a feature, get your feature branch to branch off from the latest master
. You can do a git fetch <remote_name>
and then do this -
git checkout -b <feature_branch> <remote_name>/master
Or better yet, merge the remote master
in your local master
and then create the feature branch from your local master
.
This will ensure that your is created off the latest master
on your dev server.
When you cannot push to the dev server, you can do a git pull
which will fetch and merge the latest master
, to ensure that any of your co-workers' work is included in your work. After you do that, you will not have any issues pushing your code.
Upvotes: 1