Magic link https://www.freecodecamp.org/news/git-cheat-sheet/
git branch -D friendshipsV2
git restore .\spec\models\frienship_spec.rb --staged
git clean -fd
git reset --hard
- Load previus commit
- Push by force to roleback and delete commits from github
git reset HEAD^ --hard
git push -f
git reset --soft HEAD~1
git stash temporarily shelves (or stashes) changes you've made to your working copy so you can work on something else, and then come back and re-apply them later on. Stashing is handy if you need to quickly switch context and work on something else, but you're mid-way through a code change and aren't quite ready to commit.
git stash
At this point you're free to make changes, create new commits, switch branches, and perform any other Git operations; then come back and re-apply your stash when you're ready. Note that the stash is local to your Git repository; stashes are not transferred to the server when you push.
git stash pop
Popping your stash removes the changes from your stash and reapplies them to your working copy. Alternatively, you can reapply the changes to your working copy and keep them in your stash with git stash apply
git stash -u
Adding the -u option (or --include-untracked) tells git stash to also stash your untracked files
If the changes on your branch diverge from the changes in your stash, you may run into conflicts when popping or applying your stash. Instead, you can use git stash branch to create a new branch to apply your stashed changes.
git stash branch add-stylesheet stash@{1}
git stash list
git stash save "add style to our site"
git stash pop stash@{2}
git stash drop stash@{1}
git stash clear
git add dist -f && git commit -m "Initial dist subtree commit"
git subtree push --prefix dist origin gh-pages
Boom. If your folder isn’t called dist, then you’ll need to change that in each of the commands above.
git bisect start
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
heroku create
git push heroku main
or whatever branch
heroku rename name
change app name on heroku side
https://devcenter.heroku.com/articles/getting-started-with-rails5
heroku stack:set heroku-18 --app ror-social-friends
heroku rake db:migrate --app ror-social-friends
heroku restart --app ror-social-friends