(NOTE: This documentation is a work in progress. Feel free to start an issue with it and send a pull request through github to fix the issue)
- Git lets us all contribute features at the same time without a lot of frustrations.
We'll isolate our change sets by pushing our change sets to their own feature branches. For this reason, it's convenient to automatically allow git to create a branch of the same name as your local one on the server.
git config --global push.default current
This will serve as a commands cheat sheet for common situations. All these assume you're in a valid git repo
- I want to get all the code from repo X onto my machine
git clone https://github.com/gt-big-data/X.git
- I want to create a new feature/fix a bug/refactor some code (solve an issue)
Switch to the local repo, then make a new feature branch.
git checkout -b my_cool_feature
- I want to see what I've changed, I want to see what branch I'm on, or I want to know if my merge was successful
git status
Git log will also show your latest commits
git log
Git diff will show you exactly what you've changed
git diff
- I want to commit my changes and start a code review
Add all changes to the commit, execute the commit, then push TO YOUR FEATURE BRANCH
git add .
git commit -m 'I made my_cool_feature'
git push origin my_cool_feature
Then follow github's instructions for creating a pull request
If you are denied access, please create an issue and gt-big-data admins will give you push access to all repos.
If you have push access, you will be able to merge other people's pull requests. Try not to merge your own pull requests.
If github says you can't "automatically merge this pull request," then the owner of the pull request needs to get the latest changes from master, and push those changes to their feature branch.
- I need to get the latest changes from master
git pull origin master
If there's a conflict, see git scm section on conflicts.
Note: since we're all pushing to NAMES.md, there may be conflicts.
Here's a list of pretty good git resources. Feel free to add in a pull request.
-
try.github.com is a fun, interactive, and dynamic basic tutorial to Git commands via the command line.
-
Understanding Github: a journey for beginners and it's following articles (part 2, etc.) offer a more comprehensive and detailed guide to Git commands, terms, and workfows.
-
Learn git branching is a good playground for visualizing what's going on when you execute git commands. When you feel confident enough, you can go into interactive mode
-
Git Tutorial (from atlassian) is good for learning about all the different commands. Git Basics and Git Branches are good starting points.