Skip to content

Git commands

Madeline Quang edited this page Jan 16, 2018 · 3 revisions

Git commands******

Cloning (aka getting the program from GitHub on your computer):
Download Git Bash (https://git-scm.com/downloads)
Create a folder for the project to go into
Right click on that folder and select “Git Bash Here”
git config —global user.name “YOUR_USER_NAME_HERE”
git config —global user.email “YOUR_EMAIL_HERE”
git init
git clone “https://github.com/LdhssRobotics/frc-steamworks-robot-2017.git”
It should prompt you for username and password
And you’re done!

First time committing your changes (uploading your work)
Open Git Bash in the folder frc-steamworks-robot-2017
git checkout -b “A_NAME_FOR_YOUR_BRANCH_HERE”
git push origin THE_NAME_OF_YOUR_BRANCH
git add .
git commit -m “YOUR_COMMIT_MESSAGE_HERE”
git push
Go to github.com and go to the frc-steamworks-robot-2017 project
Create a pull request
Wait for admins to approve your code.

Committing any other time
Open Git Bash in the folder frc-steamworks-robot-2017
git branch (this will show you what branch you’re on; make sure it’s the branch you want to be on)
If you’re on the wrong branch, enter: git checkout yourBranchName
git add .
git commit -m “Commit message here”
git push origin yourBranchName

Always check the error messages! They’re usually pretty useful and offer ways to fix the error.