Todo
topics
- pull requests
- pulling
- pushing
- what to do when you start
- what to do when you finish
- commit
- add
- merge
- branch
- checkout
- status
Articles
1. Concepts
add links to the corersponding usage articles if there is one
This is the why?
Introduction
Git is a developer tool for managing your source code. It has a heavy emphasis on working within a team of people.
Whenever there are more than one or two people working in the same codebase, issues are bound to arise. Git aims to solve these problems by automatically integrating the work of different developers into a single version.
Git has a very large number of features and can be extremely confusing when you are just getting started. However, assuming you follow the instructions in this guide you should be able
Exploring git (understanding how it works)
Youtube videos
repo
what is a repo?
cover remotes
history (how it tracks changes)
What is the history?
working tree
What is the working tree?
A: the files you are changing at this very moment
commits
staging
what is it?git add
HEAD
git commit
index
branches
What is a branch
why are they useful
how do they work with remotes?
GitHub
what is it?
issues
pull requests
forking (wont need to do this very often)
2. Usage
This is the how?
Introduction
graph
alias
git status is your bread and butter. run it before and after every command
practice makes perfect
Command line
getting comfortable on the command line
outline a few things, but link to command line reference page
unix vs DOS
Fixing mistakes
reset
log
stash
branching
dry runs
google :)
adding and committing
adding to staging area
removing from staging area
branching
why?
how?
3. Reference
Command line commands (unix)
- cd
- cp
- mv
- rm
- ls
- ll
- mkdir
- echo
- pipes
- << and >>
Git Commands
Give examples, describe common usage, and Link to official documentation
- push
- pull
- fetch
- commit
- add
- merge
- branch
- stash
- checkout
- different use cases
- branches
- staging
- different use cases
- status
- log
- gitk
- diff
- reset
- hard
- soft
Merging
This is in reference because you will often want to refer back to it when doing a merge.
Using VIM
youtube video
3 way merges
common cases where we will want to merge
avoid mistakes
dont take shortcuts (unless you really know what you are doing)
stashing
- pop
4. Using Github
Pull requests
what they are
how to make one
keep your commits small
Issues
for bugs and features, project management
Project management
5. Workflow
In this topic:
Outline the process
describe common scenarios
Process outline
The stuff below kind of falls under what to do when you start
** Ask yourself a series of questions. **
is the working tree clean?
do i have the most recent changes? have i merged them?
is anything stashed?
** OR **
** Follow a series of steps. **
- Gather information. Git status is your bread and butter
git status
- Look at the working tree.
- Is it clean?
- If not, what can you do with the modified files?
- Stash them
git stash
(cover usage ofgit stash pop
) - Make a new branch for them
- Commit them (if you are on a good branch for that)
- Stash them
- Once the working tree is clean, you should run
git fetch
and thengit pull
on your current branch - Next, checkout the
dev
branch and rungit pull
there as well. - If you made commits to development branch, you might now have to merge them.
- cover this
- Run
git push
- Now, move back to the branch you are working on
git checkout branchname
- OR begin working on a new branch
git checkout -b newbranch
- If you are on an old branch, update it to the latest version by running
git merge dev
- Resolve any merge conflicts that occur.
- Moving on...
- Earlier, if your working tree was dirty, unstash (if you stashed) or merge in (if you made another branch) your changes at this point
- Merge them
what to do when you start
Pull requests
Should be made for dev
AND master
(requests to master will likely be made by only a few people)
formatting
small commits
reviewing
commenting
tagging
Issues
opening
connecting to pull requests
commenting
assigning
reviewing (by seniors)
closing