Presentation is loading. Please wait.

Presentation is loading. Please wait.

Setting up Git, GitBash, and GitHub

Similar presentations


Presentation on theme: "Setting up Git, GitBash, and GitHub"— Presentation transcript:

1 Setting up Git, GitBash, and GitHub

2 https://git-scm.com/downloads
Download and install git and gitBash. For the first install I recommend just accepting all the default options. After you have become familiar with the process you can go back and tweak things while installing. (there may be more steps than I have shown)

3

4 Make sure to select to use Notepad++ as the default text editor.
Install Notepad++ first if you do not yet have it.

5 Start GitBash Start GitBash with a Desktop shortcut
… or right-click menu …or Start Menu

6 Setup the global user data for your local Git
git config --global user.name “user_name” git config --global user. Make sure that you set this up with the exact same that you used or will use when you create your GitHub account. If necessary you can set a default text editor (should be an option during gitbash installation) git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -nosession" git config --global core.editor "'C:/Program Files (x86)/Sublime Text 3"/sublime_text.exe' -w"

7 Create a Git Repository on your local machine (for quick practice example)
# Ignore everything * # But not these files... !.gitignore !src !src/** !libs !libs/** !*.txt !*.md !*.jpg !*.png # MAC HIDDEN FILES .DS_Store Createing a Git repository on your local machine. Make a folder in your drive and open gitBash in that folder git init Create a readme.txt or readMe.md file Create a .gitignore file touch .gitignore Edit the .gitignore file based on the structure of your project git add . git commit –m “first commit in project”

8 Using Git to manage version control for a local repository
setting up repo create .gitignore first commit branching git checkout merging merge conflict resolution commonly used git commands: git init git status git log git log --oneline --decorate --graph --all git add . git commit -m “message” git branch <newBranchName> git checkout <branchname> git push origin <branchname> git pull origin <branchname> git merge <branchname>

9 Connecting your local Git repository to your remote GitHub repository
The following material is pulled from the online GitHub help documentation. The details of this process is bound to change so make sure to access the original source in the future. Alternatively it can usually be found with the search “ssh for github”

10 Setup ssh using GitBash command line https://help. github
ssh-keygen -t rsa -C Example: Same recommendation as before. For initial setup of your system just keep hitting enter and accepting the default settings. You can go back later and adjust things after you have gotten everything working the first time. Register this key with the GitBash application. // starts the ssh agent which manages your keys ssh-add ~/.ssh/<name of rsa file> // this is the default location and name Public key default location on windows 7: C:\Users\<username>\.ssh\id_rsa // if username has spaces use quotes ssh-keygen -t rsa –C eval $(ssh-agent -s) ssh-add ~/.ssh/id_rsa

11 Set up an account on GitHub
Navigate to: Set up an account

12 Add this public key to your GitHub account

13 Add the ssh key to your GitHub account
Make sure to give it a title that will help you remember where it came from when you look at it again in about a year or two.

14 Test to see whether you can connect to gitHub https://help. github
Run this command in gitBash (or Mac/Linux terminal) ssh –T You should see a response similar to this: Type yes If the connection is working you should see this: The authenticity of host 'github.com ( )' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? Hi username! You've successfully authenticated, but GitHub does not provide shell access.

15 Make an empty repository on GitHub

16 Your new empty GitHub repository

17 Push a local repository to GitHub
After creating an empty repository on GitHub follow the instructions the provide to push a local repository to that remote repository. git remote add origin git push -u origin master


Download ppt "Setting up Git, GitBash, and GitHub"

Similar presentations


Ads by Google