Home Git Notes
Post
Cancel

Git Notes

Initialize a new folder

1
2
3
mkdir new_dir
cd new_dir
git init "Project name"

Set ownership globally

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

Set ownership for one folder

1
2
git config user.name "Your Name"
git config user.email "youremail@yourdomain.com"

Check the status of a git repo

1
git status

Add a file to the staging are of a repo

1
git add test.md

Commit all files in the staging area to the repo

1
git commit -m "Test message"

Enabling storing Github creds

1
git config credential.helper store

Changing to ‘main’ branch

Needed for Github

1
git branch -M main

Pushing repo to Github

1
git push -u origin main
This post is licensed under CC BY 4.0 by the author.