Skip to content

Instantly share code, notes, and snippets.

View mshjri's full-sized avatar

Omar Almashjari mshjri

View GitHub Profile
@mshjri
mshjri / .bash
Created April 20, 2020 13:12
Stash without modifying user and email
git -c user.name=test -c user.email=test stash
@mshjri
mshjri / syncBranches
Created August 25, 2019 06:18
Remove local branches that have gone from remotes scrpit
git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done
@mshjri
mshjri / delete_git_submodule.md
Created November 28, 2018 21:52 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
rails new ProjectName
cd projectName
rails server

rails generate scaffold 'post' title:string body:text
rake db:migrate
$(document).ready(function(){
});