Difference between revisions of "Git"

From Klenwell Wiki
Jump to navigation Jump to search
(Created page with "== New Repo == I use the following routine in setting up a new repository: <code>cd my-new-project TBA</code>")
 
(New Repo)
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== New Repo ==
+
== Init ==
I use the following routine in setting up a new repository:
+
I use the following routine in setting up a new repository with branches <tt>main</tt> (instead of <tt>master</tt>) and <tt>develop</tt>:
  
<code>cd my-new-project
+
<pre>cd my-new-project
TBA</code>
+
git init
 +
git commit --allow-empty -m "Initial commit on main branch."
 +
git branch -m master main
 +
git checkout -b develop
 +
git commit --allow-empty -m "Creates develop branch."</pre>
 +
 
 +
See also:
 +
 
 +
* https://stackoverflow.com/a/42871621/1093087

Revision as of 17:27, 7 March 2021

Init

I use the following routine in setting up a new repository with branches main (instead of master) and develop:

cd my-new-project
git init
git commit --allow-empty -m "Initial commit on main branch."
git branch -m master main
git checkout -b develop
git commit --allow-empty -m "Creates develop branch."

See also: