Although saying "just google it" is somewhat emotionally satisfying, in the end, not particularly helpful.
As I mentioned in the comment the chapter in branching is quite good and does a much better job of explaining git branching than I can here. Robodo also gave the correct answer, that is how you would switch to the wp
branch in order to work on it.
It's likely that you got an email saying "you're doing it wrong" because they use a workflow where master
branch represents stable deploy-able code (an example of such workflow here). Thus committing stuff directly to master is frowned upon. You should find out what workflow they use and try to follow it as well.
When you run the clone
command, get a full copy of the remote repository with all of the branches. You can view all of the branches that are available by running
git branch --all
for me, local branches are white, remote branches are red, and currently checked out branch is green.
Remote branches?
Remote branches are references to the state of branches on your remote repositories. They’re local branches that you can’t move; they’re moved automatically whenever you do any network communication. Remote branches act as bookmarks to remind you where the branches on your remote repositories were the last time you connected to them.
In order to work on a remote branch you create a local branch that tracks the remote branch and commit to that. That may sound kind of strange, but it's really just one command
git checkout -t origin/wp
Once local branches have been created you can switch between them using
git checkout <branch name>
What your workflow will likely end up being is something like this
git clone <url>
git checkout -t origin/wp // create tracking branch
git checkout -b <branch name> // branch for feature you plan to work on
... work work work ...
git add <files as needed> // you can commit locally as much as you'd like
git commit // no one will see it until you push
... when work is done ...
git checkout wp // switch to branch you will merge into
git pull // make sure it's up to date with remote code
git merge <branch you were working on> // merge your changes into wp branch and resolve
// merge conflicts, if there are any
git push // publish your changes to remote repository
There are some passionate debates about the merge vs rebase workflows. If your client has a preference, go with it. If they don't, read arguments from both sides, see which one you like better and use it.