A guide for programming within version control.
To create a repo, you can start either locally or on GitHub. If you already have
files you've created, you might want to start locally. Otherwise, it's nice to
start on GitHub because it allows you to easily add a .gitignore
, a
README.md
, and a license.
pwd
) is the project
directory where you want to work on your files.$ git init .
. This will create a repository in the current directory.$ hub create <project-name>
. This will create a repository on GitHub with
the name you specify. E.g. $ hub create 1.0-My-Project
.$ git add .
$ git commit -m "Initial commit"
$ git push -u origin master
.gitignore
, and an MIT license.$ git clone <url>
, pasting the url you just copied to clone the repository
to your computer..DS_Store
). You can ignore these files
with .gitignore
.Create a local feature branch based off master.
git checkout master
git pull
git checkout -b <branch-name>
Prefix the branch name with your initials.
When feature is complete, stage the changes.
git add --all
When you've staged the changes, commit them.
git status
git commit
Write a good commit message. Example format:
Present-tense summary under 50 characters
* More information about commit (under 72 characters).
* More information about commit (under 72 characters).
http://project.management-system.com/ticket/123
Share your branch.
git push origin <branch-name>
Submit a GitHub pull request.
$ git checkout -b <branch-name>
$ git add --all
$ git status
$ git commit
$ git push
or $ git push -u origin <branch-name>