- Don't commit directly to master
- We follow something similar to git flow, but more simple:
- When working on a new feature, we will create a new 'feature branch'
- Feature branches should be discrete work items
- When you are ready for feedback on your feature branch, open a pull request. When some or all of the team are satisfied with your changes, we will approve this and merge it in (if there are no conflicts)
|Prints the status of your current git workspace (uncommitted changes, uncommitted files, staged changes, staged files, changes ready to be pushed/pulled, etc.)
|Fetches new data from the remote
|Fetches new data from the remote and attempts to merge changes into your local branch from the corresponding remote branch (if there is one)
git checkout <branch-name>
|Switches your local git workspace to the specified branch
git checkout -b <branch-name>
|Creates a new branch,
<branch-name> and switches to it
git add [-A] <src> [<src2>, ...]
|Stages files for commit
-A - Include newly created files
<src> - Path to file(s) you wish to stage for commit (e.g.
git commit -m "<message>"
|Creates a new commit with specified message
git push -u origin/<branch-name>
|Creates a new remote branch
<branch-name> and pushes the current local branch to it
I recommened you use the same name as your local branch or risk confusing yourself
Only use this command if the remote branch does not yet exist, otherwise just use
|Push your local commits to the corresponding remote branch (if existing)
git merge origin/master
|Merges the remote
master into your current branch
Make sure you
git fetch first so you have the latest changes
You may run into conflicts doing this and if this happens, don't hesitate to contact me so I can help with resolving them
|'Stashes' your local uncommitted/staged changes
git stash pop
|Pops your last 'stashed' changes off the stack and into your current branch
If you have any additional questions, do not hesitate to ask.
If you run into any problems with
git, I would recommend asking if you're unsure as some
git commands I haven't listed here have been left out intentionally because if you're not very familiar with command line git, you have the ability to lose changes or other worse things.