-
Please clone the project using the following command:
git clone https://github.com/asolharo/piggyBank.git
-
Open the project directory in your text editor. Then switch to the
dev
branch by using the text editor's GUI or by entering the following command in the terminal:git checkout dev
-
From the
dev
branch, create a feature branch including your first name (replace "my-feature" with a simple name for what you are working on):git branch ashley-my-feature
-
Switch to your new branch:
git checkout [branch name]
-
Or do it all in one command (this creates a new branch and switches to it at the same time):
git checkout -b [branch name]
-
Send your newly created branch to the remote repository so you can push to it:
git push origin [branch name]
-
Get to work! Commit your changes often with the following commands:
git add .
git commit -m "My detailed commit message"
-
Always
pull
fromdev
before starting your work and again before pushing your changes:git pull origin dev
-
You can also run
git fetch
to see all changes to the repository. -
At any time, use
git status
for hints on what needs to be done next.
(Don't forget to pull first)
-
Set an upstream branch before trying to push in the next step:
git push --set-upstream origin [branch name]
(This only needs to be done once per new branch) -
Finally, run
git push
to send your work to the remote repository.
-
Once ready to merge your feature into
dev
, visit the GitHub repository in the browser. You should see a yellow box with a green buttonCompare & pull request
regarding your feature branch, near the top of the repository. -
You can also select the
Pull Request
tab to proceed and find the sameCompare & pull request
button. -
If all else fails, select the green
New pull request
button and choose the branch you want to pull intodev
. On theComparing changes
screen, compare changes and then selectCreate pull request
. -
After clicking the green button, on the Open a pull request page, make sure to select the branch dropdown and choose
dev
if it's not already selected. -
Leave any comments you'd like and select the
Create pull request
button. -
In the
Reviewers
section on the right, select SOMEONE YET TO BE SELECTED. -
Once reviewed, the
Merge pull request
button can be selected. -
Click
Confirm merge
.
-
When you receive the following message:
Pull request successfully merged and closed
, you can safely delete the remote feature branch with the button to the right. -
To delete the branch locally, switch to
dev
and rungit branch -d [branch name]
and then repeat steps to create a branch for your next feature!
Questions? Ask in Slack or check out this handy guide.