New Repo Creation
NB: These instructions assume github with ssh key auth but any would be similar
- Create empty repo in cloud
- Create folder on local machine with same name (same name is recommended not required)
- Open a command prompt in the folder and initialize git
git init
- Create
.gitignore
file
touch .gitignore
-
Add file and commit
-
Add remote repo connection (Can be copied from github)
git remote add origin git@github.com:wykies/REPO_NAME.git
- (Skippable) Move to main branch (-M is a shortcut for
--move --force
.) This step can usually be skipped in a new repo
git branch -M main
- Push branch to remote and set current branch as a tracking branch (-u sets current brach to tracking)
git push -u origin main