git_init

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
git_init [2021/12/31 21:00] – [Powershell] mguptongit_init [2025/12/30 16:20] (current) mgupton
Line 1: Line 1:
 ====== Git Init ====== ====== Git Init ======
 +
 +<code>
 +git init -b main # Set the name of the default branch to "main"
 +
 +git config user.name "Your Name Here"
 +git config user.email your@email.com
 +
 +git commit --allow-empty -m "Initial (empty) commit for bootstrapping the repo"
 +</code>
 +<code>
 +git checkout -b working
 +</code>
 +<code>
 +git remote add origin <remote url>
 +git push -u origin <branch>
 +</code>
  
 ==== Powershell ==== ==== Powershell ====
 +
 +=== git-init.ps1 ===
  
 <code powershell> <code powershell>
Line 10: Line 28:
     git config --global user.name "Michael Gupton"     git config --global user.name "Michael Gupton"
     git config --global user.email mg@infostar.me     git config --global user.email mg@infostar.me
-    git commit --allow-empty -m "Initial (empty) commit for bootstrapping the repo."+    git commit --allow-empty -m "Initial commit for bootstrapping the repo."
     git checkout -b working     git checkout -b working
 } }
 </code> </code>
  
  • git_init.1640984427.txt.gz
  • Last modified: 2021/12/31 21:00
  • by mgupton