Answers for "git start over"

1

git start over

# checkout the master branch
git checkout master

# create a new branch so you can find the old code easily
git branch oldStuff-KeepingForReference

# push the branch to github
git push origin oldStuff-KeepingForReference

# You currently have the master branch checked out
# so now cd to the project root and start your rewrite: 
cd <your project root>
rm -rf *

# Create a commit of the delete
git add --all *
git commit -m "Fresh start"

# Start your rewrite
echo "Some changes" > file.txt
git add file.txt
git commit -m "This is the first commit of the rewrite"
Posted by: Guest on July-04-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language