Skip to content
Mihir edited this page May 24, 2020 · 1 revision

Git WorkFlow

To contribute to this repo, this project will follow this Git workflow:

  1. Create a new branch. Feature branches help organize work on a project and make sure only production-ready code sits in the master branch. For example, a feature branch might be the static assets for the homepage. We will call this "homepage-static".

➜ git checkout -b homepage-static

Now, you can proceed to add and modify the necessary files.

  1. Commit your changes to the current branch.
➜  git add .
➜  git commit -m "Update homepage with nav bar"

It's a good time to merge your changes.

  1. Switch to the master branch.

➜ git checkout master

  1. Make sure you're up to date on your local master.

➜ git pull origin master

  1. Switch back to your other branch you'd like to merge.

➜ git checkout homepage-static

  1. Merge with the local master branch.

➜ git merge master

You may see merge conflicts at this point. It's your job to resolve simple merge conflicts, however, if there are tricky conflicts, get one of your team members to help. Follow this guide to assist you with solving these conflicts.

  1. Add and commit your changes.
➜  git add .
➜  git commit -m "Fix conflicts; merged with master"
  1. Push your feature branch to the remote repo.

➜ git push origin homepage-static

  1. Go to this repo page and you should see a prompt to create a pull request. Go ahead and do so. Let someone else on team know you've made a pull request as so they can review your changes.

Once someone has approved it, proceed to the next steps to merge branch to master.

  1. Go to the specific pull request page. It should be visible once the pull request is created. If not, you can go to the "pull request" tab.

  2. Click on "Merge pull request". If the Merge pull request option is not shown, then click the merge drop down menu and select Create a merge commit. This will pull in the commit history of the other branch into the master branch.

  3. Type a commit message, or accept the default message. Under the commit message box, click "Confirm merge".

  4. If you're done adding the feature, delete the branch to keep things tidy.

To delete a branch completely, you will need to delete the remote and local branch. To delete a remote branch, you can use the GitHub interface and select delete when either prompting you after you merge your pull request or if you select to view branches from the menu. Once that is done, you will need to update your local cache of remote branches:

➜ git fetch -p origin

If you wish to delete your remote branch using git commands, you can do the following:

➜ git push -d origin homepage-static

Then, to delete your local branch, do the following:

➜ git branch -d homepage-static

If you ever want to see a list of your active branches, run:

➜ git branch -a

Style Conventions

We will follow style conventions to establish consistency with our codebase.

HTML/CSS:

HTML/CSS Google Style Guide

For naming, we will use hypens. Example: <p class="intro-info"></p>

JavaScript:

Airbnb Style Guide

Clone this wiki locally