Reference repo on the usage of Git on FRC Team 5458 systems.
All commands should be run via Git Bash.
git config --global init.defaultBranch main
git config --global core.autocrlf true
git config --global core.safecrlf warn
git config --global user.name "FRC5458"
git config --global user.email [email protected]
# Create SSH folder if needed
mkdir -p ~/.ssh
# Navigate to SSH Folder
cd ~/.ssh
# Create SSH Key to Use with Project Repo Only. Don't Set Password on Key
ssh-keygen -t ed25519 -f {project_name} -C "{project_comment}"
# Create SSH Config
vim ~/.ssh/config
# Each project will need an entry in the SSH Config file
#===== ~/.ssh/config ==========
# Host github-{project_name}
# HostName ssh.github.com
# Port 443
# User git
# IdentityFile ~/.ssh/{project_name}
# IdentitiesOnly yes
#
# Set Required Permissons on Config
chmod 600 ~/.ssh/config
An Admin of our GitHub organization will have to complete this step. Currently, only mentors are admins.
Github Repo -> Settings -> Deploy keys -> Add Deploy key
cat ~/.ssh/{project_name}.pub
ssh-keyscan github.com >> ~/.ssh/known_hosts
# Only Run from SSH Enabled Network
# Navigate to New Local Project Folder
cd {project_folder_path}
# Initialize Git
git init
# Add Remote Repo
git remote add origin git@github-{project_name}:FRCTeam5458DigitalMinds/{repo_name}.git
# Navigate to Local Project Folder
cd {project_folder_path}
# Stage Changes
git add --all
# Commit Changes
git commit -m '{commit_comment}'
# View Remote Name (Default should be 'origin')
git remote -v
# Push to Github
git push origin --all
# Clone Repo From Code Already in GitHub
git clone git@github-{project_name}:FRCTeam5458DigitalMinds/{repo_name}.git