howthiswasinited.bash 3.5 KB

  1. #!/bin/bash
  2. if test -d '.git'; then
  3. echo 'Already inited! ./.git dir already exists! not deleting!'
  4. exit 1
  5. fi
  6. git init .
  7. git config --local -l
  8. git config --local core.autocrlf false
  9. git config --local -l
  10. #ln -rs githooks/pre-commit .git/hooks/pre-commit
  11. #ls -la .git/hooks/pre-commit
  12. set -e
  13. ./setup_githooks
  14. set +e
  15. git add .
  16. git add --force "OSes/archlinux/etc/pam.d/shadow" #because /etc/shadow is excluded via a generic "shadow" file rule.
  17. git add --force "OSes/archlinux/home/user/build/1packages/4used/kernel/linuxgit/makepkg_pacman/linux-git/src/linux-git/"
  18. git add --force "OSes/archlinux/home/user/build/1packages/4used/kernel/linux-stable/makepkg_pacman/linux-stable/src/linux-stable/"
  19. git add --force "system/Z575/OSes/manjaro2/on_baremetal/filesystem_now/manjaro/home/z/build/1packages/kernel/linuxgit/makepkg_pacman/linux-git/src/linux-git/"
  20. git add --force "OSes/archlinux/${HOME}/build/1packages/4used/kernel/linuxgit/makepkg_pacman/"
  21. #^ that's an ignored path, so had to force add once! Hmm, --force seems optional but it's not! without --force it just seems to work but it doesn't add it and it doesn't err or exit code
  22. git add --force "OSes/archlinux/${HOME}/build/1packages/4used/vim-iptables/sources_pacman/iptables.tar.bz2"
  23. #^ another ignored path, 5k file which would require port 80 to get!
  24. git add --force "OSes/archlinux/home/user/bin/confHOME/home/user/.vim/bundle/ale/.gitinfo.log"
  25. #^ needed because ale's .gitignore is set to ignore ".*" aka all hidden files!
  26. git add --force "OSes/archlinux/home/user/bin/confHOME/home/user/.vim/bundle/ale/.appveyor.yml"
  27. git add --force "OSes/archlinux/home/user/bin/confHOME/home/user/.vim/bundle/ale/.editorconfig"
  28. git add --force "OSes/archlinux/home/user/bin/confHOME/home/user/.vim/bundle/ale/.gitattributes"
  29. git add --force "OSes/archlinux/home/user/bin/confHOME/home/user/.vim/bundle/ale/.github/"
  30. git add --force "OSes/archlinux/home/user/bin/confHOME/home/user/.vim/bundle/ale/.gitignore"
  31. git add --force "OSes/archlinux/home/user/bin/confHOME/home/user/.vim/bundle/ale/.travis.yml"
  32. git add --force "OSes/archlinux/home/user/bin/confHOME/home/user/.vim/bundle/vim-better-whitespace/.gitinfo.log"
  33. git add --force "OSes/archlinux/home/user/bin/confHOME/home/user/.vim/bundle/vim-unimpaired/.gitinfo.log"
  34. git add --force "OSes/archlinux/home/user/bin/confHOME/home/user/.vim/bundle/workflowish/.gitinfo.log"
  35. git add --force "OSes/archlinux/home/user/build/amdmsrtweaker-lnx/.gitinfo.log"
  36. chmod a-x,a-w "$0"
  37. repo_dir_name="$(basename "$(pwd)")" #ie. a3 or s4
  38. gitoriginme "$repo_dir_name"
  39. #arg is the name of the current folder aka: $ basename `pwd`
  40. git_add_remote_backupto #XXX: this must use same value of $localreponame from below as the remote name!!
  41. #XXX commented out the following due to being in ~/bin/git_add_remote_backupto :
  42. ###git remote add --mirror=push backupto "file://${HOME}/backups/d3_local_upstream_repo"
  43. ###git remote add backupto "file://${HOME}/backups/d3_local_upstream_repo"
  44. #destlocalremoterepo="${HOME}/backups/${repo_dir_name}_local_upstream_repo"
  45. #mkdir -p -- "$destlocalremoterepo"
  46. localreponame="backupto" #ie. "origin"
  47. #set -e
  48. #pushd "$destlocalremoterepo"
  49. #git init --bare
  50. #popd
  51. ##git remote add --mirror=push "$localreponame" "${destlocalremoterepo}"
  52. ##no mirror or else i can't see how many commits ahead is current repo compared to upstream($destlocalremoterepo)
  53. #git remote add "$localreponame" "${destlocalremoterepo}"
  54. set +e
  55. git add "$0"
  56. ./showignored || git status --ignored
  57. echo "!! Don't forget to do this next:"
  58. echo "git commit -a && git push -u --all \"$localreponame\" && git push -u --tags"