Getting started with GitHub
//why?
//why?
- Code backed up to remote location
- Collaboration made easy
- Version control (git)
Developer pack
https://education.github.com/pack
100% free with a @byu.edu email address
Benefits
- $100 credit, Digital Ocean
- Free .me domain name, NameCheap
- 5 private repos (normally $7/mo)
- + much more
End objectives
By the end, you will have 2 working repositories that you can use for school work, side projects, or even a personal website.
Let's get started...
- In the upper-right corner of any page, click +, and then click New repository.
-
Create a new repository named username.github.io, where username is your username
Optionally, add a description of your repository. -
Create it as a public repository.
- Normally you can choose public or private.
- Select Initialize this repository with a README.
- Click Create repository.
Create your first repo
Let's get started...
- In your repository's list of files, click README.md.
- Above the file's content, click .
- On the Edit file tab , type some information about yourself.
-
Above the new content, click Preview changes.
-
Review the changes you made to the file. You'll see the new content in green.
- At the bottom of the page, under "Commit changes," type a short, meaningful commit message that describes the change you made to the file.
- Click Commit changes.
Commit your first change
I have a repo. Now wut?
Let's add some files
It's personal choice:
-
Install git (preferred)
- git-scm.com/downloads
-
Download the GitHub GUI client
- windows.github.com
- mac.github.com
-
Alternative Git client
- sourcetreeapp.com
- code.google.com/p/tortoisegit/wiki/Download
There is no standard, but aligning to a specification will help you stay organized
But where should I put my code?
Windows
C:/dev
Mac
/username/dev
Create directories for each organization, project, or milestone
What exactly does this do?
It copies the project folder and git files that track changes.
A Git workflow looks like this:
- A Git repository stores the full history of all of its branches and tags within the .git directory.
- The latest stable release is contained within the master branch.
- Active feature work is developed in separate branches.
- When a feature is finished, the feature branch is merged into master and deleted.
Clone!
git clone https://github.com/<u>/<reponame>.git
cd username.github.io
Let's add:
index.html
/css/style.css
/js/script.js
Extra credit:
Implement a "Holy Grail" layout
philipwalton.github.io/solved-by-flexbox/demos/holy-grail/
Create some files
Commit early, commit often.
A tip for version controlling - not for relationships
Commit and push!
git add .
git commit -m "First commit"
git push
Round 2
Now lets create another repo for a project that you already have
- Create new repo on Github
- Clone to your dev location
- Copy existing files to repo folder
- Add to git
- Push to GitHub
- Invite others to collaborate
IDE Integration
PyCharm Demo
Download at:
jetbrains.com/pycharm/
Unlock the Enterprise Edition for free by applying for an educational account at jetbrains.com/student/
Color | Status | Description |
---|---|---|
Blue | Modified | File has changed since the last synchronization |
Brown | Unknown | File exists locally, but is not in the repository and is not scheduled for adding |
Green | Added | File is scheduled for addition to the repository |
Red | Merged with conflicts | During the last update, file was merged with conflicts |
Grey | Delete | File is scheduled for deletion from the repository |
More info at jetbrains.com/idea/help/file-status-highlights.html
File Status Colors
- Custom URLs
help.github.com/articles/setting-up-a-custom-domain-with-github-pages/ - Use .gitignore file to omit some files (config, cache) from VCS
- Pro Git - free book
git-scm.com/book/en/v2 - Using Issues, GitHub's issue tracker
github.com/blog/831-issues-2-0-the-next-generation
Advanced stuff
GitHub Graduation
(just a cool sticker, actually)
VAF-Github
By Carlos Filoteo
VAF-Github
- 792