User Tools

Site Tools


computing:git:new-repo-from-scratch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
computing:git:new-repo-from-scratch [2026/08/30 12:45] – [Upload source tree] oscarcomputing:git:new-repo-from-scratch [2026/12/01 04:42] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== Create GIT Repo from Scratch ====== 
  
----- 
-==== Create Forgejo Repo ==== 
-Create the new repository that we want to populate and start using (e.g. "homesite") 
-==== Upload source tree ==== 
-Now we will prepare and upload the source tree to the repository.  
-On the local computer enter the directory where the sources are and execute: 
-=== .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. 
-=== Setup user references === 
-  $ git config --global user.email "oscar@oscardegroot.nl" 
-  $ git config --global user.name "Oscar de Groot" 
-=== Upload to local repo === 
-<code> 
-git init 
-git switch -c main 
-git add . 
-git commit -m "first commit" 
-</code> 
-  * 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 === 
-<code> 
-git remote add origin http://192.168.178.86:3000/git-admin/homesite.git 
-git push -u origin main 
-</code> 
-  * git remote add: will add and connect a remote server/repository to our local git. The will be called and references as: "origin" 
-  * git push:  will push all committed files to the remote called "origin". "-u" sets the upstream tracking branch, linking your local main branch to origin/main. Once you do this once, future pushes and pulls on that branch can just be: git push; git pull. Instead of needing to specify origin main every time. 
-=== Authorization === 
-The "git push -u origin main" command will prompt for a username/password. Use the forgejo main account (default is: **git-admin/git-admin-passwd**). 
computing/git/new-repo-from-scratch.1788093958.txt.gz · Last modified: by oscar