Repository for the final project
-
Create your development branch.
- Either locally in your terminal
- First, checkout the branch you wish to base your working branch off of.
git checkout <origin_branch>
- Create your branch
git checkout -B branchName
- First, checkout the branch you wish to base your working branch off of.
- Or on the GitHub repository page
- In the
Code
tab, select the branch you wish to base your working branch off of. - In the
Code
tab again, 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 .
- Be careful with this command. It may add files you do not wish to commit. Run
git status
first to see the files that git has identified as new or changed. If there are files that you think should not be added, you can add them to the .gitignore file at the top level of the repository.
- Be careful with this command. It may add files you do not wish to commit. Run
- 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.- If you have any conflicts and aren't sure how to resolve, message Chris for a zoom meeting to be walked through the process.
- 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.