Thursday, February 29, 2024
HomeSoftware EngineeringLearn how to Create an Empty Department in Git

Learn how to Create an Empty Department in Git


If it is advisable create an empty department in git, you’ll be able to observe one of many beneath choices.

In case you are utilizing git model 2.27 or newer, then observe the change route (choice 1) beneath, in any other case fall again to the older approach, utilizing checkout and delete (choice 2).

Newer approach – Utilizing change:

git change --orphan <new department>
git commit --allow-empty -m "Preliminary commit on orphan department"
git push -u origin <new department>

Older approach – Utilizing checkout and delete:

git checkout --orphan <new department>
git rm -rf .
git commit --allow-empty -m "root commit"
git push origin <new department>
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments