computing:git:new-repo-from-scratch
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| computing:git:new-repo-from-scratch [2026/08/28 08:37] – oscar | computing:git:new-repo-from-scratch [2026/08/30 12:45] (current) – [Upload source tree] oscar | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| === .gitignore === | === .gitignore === | ||
| Create in the root of the source tree a .gitignore file and add all the files and folders that need to be excluded from the upload to the repositories. | Create in the root of the source tree a .gitignore file and add all the files and folders that need to be excluded from the upload to the repositories. | ||
| + | === Setup user references === | ||
| + | $ git config --global user.email " | ||
| + | $ git config --global user.name "Oscar de Groot" | ||
| === Upload to local repo === | === Upload to local repo === | ||
| < | < | ||
| Line 16: | Line 19: | ||
| git commit -m "first commit" | git commit -m "first commit" | ||
| </ | </ | ||
| + | * git init: will prepare local repository by creating the .git directory | ||
| + | * git switch: will create the main branch and switches the local repo to it. | ||
| + | * git add . : will state all files to the local staging area | ||
| + | * git commit: will commit all staged file in the local repo | ||
| === Upload to remote repo === | === Upload to remote repo === | ||
| < | < | ||
| - | git remote add origin http:// | + | git remote add origin http:// |
| git push -u origin main | git push -u origin main | ||
| </ | </ | ||
| - | * git init: will prepare local repository | + | * git remote add: will add and connect a remote server/repository |
| - | * git switch: will create | + | * git push: will push all committed files to the remote called " |
| - | * git add README.md | + | === Authorization === |
| + | The "git push -u origin main" command will prompt for a username/ | ||
computing/git/new-repo-from-scratch.1787906252.txt.gz · Last modified: by oscar
