Git

From Piszczynski
Revision as of 18:51, 20 November 2025 by Aleks (talk | contribs)

Git Commands

See status:

git status

Add more than one file to the git repo:

git add .
git add *

Commit files to local repo:

git commit -m "message to commit"

Push changes to remote repo:

git push origin master

Create Local Git Repository

Create a folder for the git repository then use the following command to initialise it as a git repo:

git init

GitHub

Once git is installed and repo is cloned set the global username and password to allow automatic push and pull to work:

  • git config --global user.name "Your Name"
  • git config --global user.email "youremail@yourdomain.com"

Add SSH keys for use with github

generate keys:

ssh-keygen -t ed25519 -C "your_email@example.com"

Add key to ssh agent: start service:

# start the ssh-agent in the background
Get-Service -Name ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent

Add SSH key:

ssh-add c:/Users/YOU/.ssh/id_ed25519

Add the public key to github: find the .pub file and add to github: Find key in folder:

gc ssh-add c:/Users/YOU/.ssh/id_ed25519.pub

copy and paste public key into the keys section in github for account/repo