Github – How to use git, github, and gh-pages



Github – How to use git, github, and gh-pages

0 0


github-presentation


On Github joshuajharris / github-presentation

Github

How to use git, github, and gh-pages

by joshuajharris / ODU ACM Secretary

Welcome

  • Get you started contributing, and sharing projects
  • Importance: Gain experience, get your name out there

Git

  • Source Version Control
  • Used at major companies like....

History of Git

  • Born in 2005
  • bitKeeper revoked linux kernal's free of use status
  • Developed by linux kernal community, specifically linus torvalds

Install Git

Windows

If you use chocolatey run
						choco install git.install
					
or install git bash

Linux

Install "git" via your package manager
Example: Ubuntu
						sudo apt-get install git
					

Mac OSX installed by default

  • Git Bash Should be installed on the lab computers
  • Git gui clients

Quick Check (Mac & Linux)

git --version

Windows: check if git bash is installed

Git Basics

Inside of your project directory, type

						git init
					

Git Basics cont...

Check status, Add a file

						
git status
git add test.js
						
					

Git Basics cont...

Commit

						git commit -m 'Added a super awesome test file'
					

Branches

"Branching means you diverge from the main line of development and continue to do work without messing with that main line" from git docs

Branches example

  • One Branch - master
  • Green: Commit

						git branch testing
					

  • Created a new branch
  • Branch initially is exactly the same as where it was branched from

Branches Cont...

  • Head: Pointer to current branch
  • Haven't switched to new branch yet, still on master
					git checkout testing
				

  • Head: Switched to test branch

						
vim test.rb
git commit -a -m 'made a change'
						
					

  • Used vim to make changes to file
  • -a --all automatically stage files that have been modified and deleted
  • but new files you have not told Git about are not affected.
  • -m message
					git checkout master
				

  • Switched to master branch
  • Notice: testing points to commit ahead of master
					
vim test.rb
git commit -a -m 'made other changes'
					
				

  • Made new commit as master
  • Can really start to see a branching effect

Git Learning Resources

Github

  • Most employers now ask for github profile on resume

Who Uses Github

From 2013, jmduke Company Repositories Forks Stars Language google 85 1336 12250 C adobe 32 3862 19231 C++ twitter 103 6057 43780 C++ paypal 114 1046 1868 None aws 18 1693 6221 Java yahoo 143 1129 4805 JavaScript linkedin 52 1501 7932 Java facebook 102 15311 64907 C++ dropbox 19 178 1329 PHP mozilla 687 11500 44232 C++

  • About 50 Countries Governments use github

Github Keywords

  • repo: Repository, storage space for your project
  • fork: a copy of a repository
  • issues: way to keep track of bugs, tasks, and enhancements
  • review: high-level overview of what exactly has changed between your branch
  • pull request: let you tell others about changes you've pushed to a repository on GitHub

How to push content

						
git remote add origin git@github.com:yourusername/repo-name.git
git push origin branch-name
						
					

Contributing

  • The biggest reason for github
  • Employers love to see it
  • Great way to learn, get noticed?

Contributing How To

  • Look for a smaller project
  • Project you are interested in
  • Check out the issues tab for small tasks you can accomplish

How To Get other to Contribute

  • Add Collaborators
  • Have good documentation
  • Make good issues

gh-pages

pages.github.com

gh-pages how to

create new repo named yourusername.github.io

gh-pages how to cont...

Now push content to the repo in static files like .html, .js, .css and go to yourusername.github.io in your browser

Project pages

Pick a template

Thanks

joshuajharris on p.s. use slack oduacm.slack.com

References

Github How to use git, github, and gh-pages by joshuajharris / ODU ACM Secretary