Git and GitHub NotesGit is a version control system. It tracks all the changes that you make. Git Bash is a Git tool for Windows. Once you have installed Git Bash, you will be able to browse to your directory that contains your software project, right click and select "Git Bash Here" to control your project with Git. GitHub is the online Hub where you commit your files for everyone to use. The Pro Git book, available for free online, will also be useful to you for learning Git. Initial GitHub Setup ProcessCreate an account on GitHub. On Windows, install Git Bash. Once you have installed Git Bash, you will find it in a Git folder in your Apps. Video - Installing Git BashSetup your username and password locally using Git Bash. So you don't have to type in your password every time you connect to Git Hub, setup your local Git with an SSH key. Check for an existing SSH key with: ls ~/.ssh Create a private and public SSH key, and give Git Hub the public key. https://help.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh Check SSH is setup correctly using: ssh -T git@github.com How to Start a New Local Git Repositoryhttps://kbroman.org/github_tutorial/pages/init.html Making Your First Local Commit with git commitGit Handbookhttps://guides.github.com/introduction/git-handbook/ GitHub Video Tutorialshttps://www.youtube.com/githubguides Learn Git VideoGitHub Basics - The GitHub WorkflowCommand: git add . Will add all the changes that you've made to the project. You then need to commit them, it's a two step process. The commit is taking a snapshot. git commit -m "Your message here" Git StagesFile as your working copy. git add - adds it to the staging area. git commit - commits the file to the local repository. git push - uploads your changes to GitHub. GitHub Workflow VideoGit - How to Edit FilesGit Tutorial - How to View the Changes Made to FilesLearn Git and GitHub - Crash Course VideoGit Bash CommandsShow Git Config Infogit config --list Show Current Directory git Is Inpwd Cycle Through Previous CommandsNote, Up arrow will cycle you through your previous commands to save you typing. Show All Files in Current Directoryls Clear Screenclear To Open Git Bash at Correct DirectoryBrowse into the directory in Explorer, then right click and select Git Bash here. Set Username and PasswordNote, use your GitHub username and e-mail when entering these commands: git config --global user.name "Your name here" To check Username and Password set correctly: git config --list Note, each time you submit to GitHub, you will need to type in your password. If you don't want to do this each time, you can set up an SSH key. Initialize Git for a New ProjectRun the git init command from the folder that contains all of your project files. See https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-init This will add a .git folder. Add Files to Staginggit add Commit Changesgit commit View Commit Historygit log View Commit History from a Particular Person git log --author="Person" View Statusgit status Show Differences Between Your Working Copy and the Repositorygit diff Pulling Changesgit pull Copies everything from the remote repository to your computer. Upload Changes to a Remote Repository on GitHub / Add a Project to GitHubget push See https://www.atlassian.com/git/tutorials/syncing/git-push Creating a New Git RepositoryOpen git bash. Change directory to the directory where you want the Git repo (use cd command). Then use: git init command. Which will create a .git directory within your target directory.
Visit LowPrices.co.uk for Your UK Shopping How To Submit Your First Pull Request on GitHubResourcesGitHub Explore Using GitHub with Visual Studio Code Git Hub BooksThe Pro Git book, available for free online.
|
|
All Content ©2020 WebRef.eu |