Occasionally while working on a program or website, someone on your team will make changes to the source code. When you go to push your code up to the server. You will get an error, called a Merge Conflict. This video will show you how to handle this, making sure that nobody's code is overwritten.
Creating a branch (or multiple branches) is usefull when you want to do some refactoring or are looking to add new features to a project, but you don't want to risk messing up the team's working version.
For reference, here are the commands used:
git fetch
- Get the branch (and commit, etc) information from the server.git checkout <branch name>
- Switch to a different branch.
Now that you know how to merge and use branching, let's look at how to merge a branch back into the master.
Granting User Access
By now I've surely said, "if you're working with a team..." at least ten times. In this video, I'll show you how to add team-members to your repository in Bitbucket.
Review Questions
The following are examples of questions similar to what you can expect to see on the next exam.
- What is a merge conflict? When you have local changes and server changes that conflict.
-
What does
git checkout
do? Switches the current working branch.