Sensor and Mobile computing project
-
Create your development branch.
- Either locally in your terminal
git checkout -B branchName
- Or on the GitHub repository page
- In the
Code
tab, press theBranch: currentBranch
drop down button. - Enter a branch name in the text field.
- Click "Create branch: branchName from 'currentBranch'"
- On your dev machine, do
git fetch
followed bygit checkout branchName
- In the
- Either locally in your terminal
-
Develop and test
-
Stage your changes, commit them, and push to the remote repository.
- Stage with
- A single file, tracked or un-tracked:
git add fileName
- All modified, tracked files:
git add .
- A single file, tracked or un-tracked:
- Commit:
git commit -m "Some commit message"
- Push:
git push
- If you created locally, you will need ensure your branch is created upstream.
git push -u origin branchName
Later pushes will work with justgit push
- Create a Pull Request
- It's generally good practice to merge into the branch (target branch) from which you created your dev branch. Additionally, to ensure your dev branch is up to date, you should first merge the target branch into your dev branch.
- Checkout the target branch.
git pull
to update- Checkout your dev branch.
- Merge target branch into your dev branch.
git merge targetBranch --no-ff --no-commit
--no-ff
and--no-commit
ensures that the merge is not fast-forwarded nor automatically committed.- Resolve conflicts, if any. Stage and commit changes.
git commit
We can omit a commit message and use the default merge message. Simply writequit the editor that opens.
- Push :
git push
- On GitHub, navigate to your branch and click the button to create a pull request. Once approved, repeat steps
i
throughv
if the target branch has had commits made to it while your pull request was being reviewed.