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.
- fork GCWeb repo
git clone https://github.com/**_username_**/GCWeb.gitcd GCWebgit remote add upstream https://github.com/wet-boew/GCWeb.git
./scripts/setup// creates the lib and node_modules foldersgrunt// creates the dist folder
git pull upstream master// make sure your local master is checked outgit checkout -b _new branch_- make changes
- build your dist folder
grunt
- test your changes
git add .git commit -m "_new commit message_"git push origin _new branch_- On Github in your repo page, make a new pull request.
- Once merge has been made, repeat steps 1 and 2.
git branch -d _new branch_
git rebase _master_// updates the active branch with missing commits from the tragetted branch, this case mastergit log// lists the commits (q to exit list in terminal)git log --oneline// lists the commits in just a single linegit commit --amend// adds the staged changes into the last commit and give you the option to change your commit messagegit status// views what files have been changed in your repogit rebase -i HEAD~#// # being the number of commits you want to be listed in your rebase, you can than squash commits togethergit branch// lists all the branchesgit branch -a// lists all the branches including the remote onesgit remote -v// lists all the remotes and their URIsgit reset [commit]// Undoes all commits afer [commit], preserving changes locallygit reset --hard [commit]// Discards all history and changes back to the specified commit