Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 2.09 KB

git-workflow.md

File metadata and controls

48 lines (37 loc) · 2.09 KB

Git workflow - GCWeb

by @shawnthompson

This is a page created to share my Git workflow for the GCWeb project on Github. Using Git Bash or Teminal on either Mac or Linux.

Cloning and Installation

  1. fork GCWeb repo
  2. git clone https://github.com/**_username_**/GCWeb.git
  3. cd GCWeb
  4. git remote add upstream https://github.com/wet-boew/GCWeb.git

Building WET

  1. ./scripts/setup // creates the lib and node_modules folders
  2. grunt // creates the dist folder

Maintenance / Changes

  1. git pull upstream master // make sure your local master is checked out
  2. git checkout -b _new branch_
  3. make changes
  4. build your dist folder
    • grunt
  5. test your changes
  6. git add .
  7. git commit -m "_new commit message_"
  8. git push origin _new branch_
  9. On Github in your repo page, make a new pull request.
  10. Once merge has been made, repeat steps 1 and 2.
  11. git branch -d _new branch_

Useful Git commands

  • git rebase _master_ // updates the active branch with missing commits from the tragetted branch, this case master
  • git log // lists the commits (q to exit list in terminal)
  • git log --oneline // lists the commits in just a single line
  • git commit --amend // adds the staged changes into the last commit and give you the option to change your commit message
  • git status // views what files have been changed in your repo
  • git rebase -i HEAD~# // # being the number of commits you want to be listed in your rebase, you can than squash commits together
  • git branch // lists all the branches
  • git branch -a // lists all the branches including the remote ones
  • git remote -v // lists all the remotes and their URIs
  • git reset [commit] // Undoes all commits afer [commit], preserving changes locally
  • git reset --hard [commit] // Discards all history and changes back to the specified commit

Github Git Cheat Sheet (PDF)