The way we work with git is that for every remote pair programming session we create a separate branch. We give it a name after the feature we're working on.
It automatically switches to this branch.
During our work we tend to checkin our changes quite often. We do it with:
After we finish our session, we do two things.
First, we merge our branch to master:
Then, we delete the branch we were working on:
That's it.
If you happen to delete the branch BEFORE you merge it, don't panic, there is a solution.
In order to undelete a branch just after you deleted it, do:
git checkout -b feature1
It automatically switches to this branch.
During our work we tend to checkin our changes quite often. We do it with:
git checkin -a -m "created some specs for class A"
After we finish our session, we do two things.
First, we merge our branch to master:
git checkout master
git merge feature1
Then, we delete the branch we were working on:
git branch -D feature1
That's it.
If you happen to delete the branch BEFORE you merge it, don't panic, there is a solution.
In order to undelete a branch just after you deleted it, do:
git checkout -b new_branch_name HEAD@{1}