How to add a new repo on github
- create a new Git repo in github.com
- find the link to your repo
cd
to your local project dir and dogit init
git remote add origin
remote repo URL- if some of your folders/files are from other repo and chances are they will have .git/ folder in them, to see ahidden folder do
cd .
andtab tab
- if there is
.git/
folder, you can decide to wethere to make it submodule or delete the.git/
byrm -rf .git
git add .
will add everything inside dir, individual add bygit add readme.md
, usegit add -u
to add only updated tracked files- `git commit -m "mesage you want to add to this commit"
git branch -M main
to set the branch name to be main, ( master if you want)git push -u origin main
if this is first time, afterwards usegit push
How to remove a git directory
git rm -r --cached FolderName
git commit -m "Removed folder from repository"
git push origin master
How to fork a repo and link back and update and finally start a PR use link https://www.tomasbeuzen.com/post/git-fork-branch-pull/