Download presentation
Presentation is loading. Please wait.
Published byHenry Neal Modified over 8 years ago
1
Using Git with collaboration, code review, and code management for open source and private projects. & Using Terminal to create, and push commits to repositories hosted on Github. How the heck do i use github & Command line?
2
Benefits of using Github GitHub is the largest code host on the planet with over 11.4 million repositories Integrated issue tracking via Pull Requests Collaborative code review Create Teams & Organizations Receive and give contributions to projects Track your progress and projects you've worked on
3
Benefits of using Command Line vs Git GUI Git was written for command line Using Git through an application is actually a hack Git GUIs make git more difficult and complicated Git terminal commands are simple. It doesn’t need an application, often times the applications will create weird commits, weird branches, and screw up your files. It’s just faster from the command line.
4
Github Workflow 1.Create a Repository: This is the master branch and should be working and ready to deploy at any time 2.Make a Branch: Branches are created so that you have an environment to try out new things and make changes to your code without wrecking the master branch 3.Add Commits: Whenever you add, edit, or delete a file, you're making a commit, and adding them to your branch. Commits help you keep track of your progress as you work on a branch.
5
Github Workflow 4.Open a Pull Request: Pull Requests initiate discussion about your commits. Pull Requests also provide a way to notify project maintainers about the changes you'd like them to consider. 5.Discuss & Review your changes: Once a Pull Request has been opened, the person or team reviewing your changes may have questions or comments. 6.Merge & Deploy: Once your Pull Request has been reviewed and the branch passes your tests, it's time to merge your code to the master branch for deployment. Github automatically compares both branches to see if the branches are able to be merged.
6
Git Commands git init - Initializes a git repository within the current directory you are in. git status - Shows the current status of the project, displays what files have been changes and which files are staged and ready to be commited. git add {index.html} - Adds the file to the staging area and git to start tracking the file and watch for changes. git commit -m “this is a commit message” - Stores our staged changes with a message describing what was changed. git log - Displays a log of all the commits we’ve made so far. git remote add origin https://github.com/gituser/reponame.git - Connects the initialized repository to the remote repository located on github.https://github.com/gituser/reponame.git git push -u origin master - Tells git where in the repository to put our commits. git pull origin master - Pulls down any new changes from the master repository to your local copy of the repository. git clone https://github.com/gituser/reponame.git - Clones a local copy of a repository on github into a newly created directory, also initializes and begins watching the directory.https://github.com/gituser/reponame.git
7
Lets see… but just how easy is it?
8
Useful Resources http://try.github.io/ - Awesome beginner github & command line tutorial made by Codeschool. http://try.github.io/ https://help.github.com/articles/set-up-git - A short guide by github on how to set up git. https://help.github.com/articles/set-up-git https://help.github.com/articles/create-a-repo - Short guide by github on how to create and initialize a repository on github. https://help.github.com/articles/create-a-repo
9
Questions: 1. What is the command to Initialize a git repository? Git init. 2.What is it called when you open an issue on a repository? Pull Request 3.What are 2 benefits of using command line over a git GUI? Its faster, simpler and more reliable. 4. What is the biggest draw to using github? Its collaborative.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.