* To sort of start over on a directory

  1. edit the .gitignore appropriately

  2. git rm -r --cached .

     this command recursively removes all files from the index, but it doesn't delete them locally

  3. git add .

     this command adds all files in the current directory and subdirectories using the current .gitignore

  4. git commit -m 20240301



* 
  greg@MSI:~/ggit/qbox$ git config --global user.email "greg@MSI.subckt.org"
  greg@MSI:~/ggit/qbox$ git config --global user.name  "Greg MSI"


* To completely clear the history of repository

  * *********************************
  * In one of the cloned locations
  * *********************************
  git checkout --orphan newBranch
  git add -A                         # Add all files (seems unnecessary)
  git commit -m HelloWorld
  git branch -D master               # Deletes the master branch
  git branch -m master               # Rename the current branch to master
  git push -f origin master          # Force push master branch to github
  
  git branch --set-upstream-to=origin/master master
  git gc --aggressive --prune=all
  
  * *********************************

  * *********************************
  * Now in each copy of this repository
  * *********************************
  git fetch --all
  git reset --hard origin/master
  git gc --aggressive --prune=all
  * *********************************

   

* To create a git ssh key

    ssh-keygen -t rsa -b 4096 -C "someone@somewhere.org"

    (creates id_rsa.pub)

  

* To update and thus know if you're up-to-date or behind the remote

    git remote -v update
    git status


* To undo changes TO ALL TRACKED FILES since last commit

    git reset --hard HEAD^


* To restore a tracked file that has been modified since last commit

    git checkout -- <file>


* To quit tracking a file or directory

    git rm    --cached <file>

    git rm -r --cached <folder>


* To quit tracking a file and remove it

    git rm <file>


* To ignore a file add it to .gitignore



* To show difference between current and last commit

  git diff HEAD^ HEAD


* To create an ssh key

  ssh-keygen -t rsa

* To see all you branches

  git branch -vva

* To checkout a remote branch

  git checkout <branch>

  If branch is the name of a remote branch that does not currently exist locally
  then this will create a new local branch with the same name, and will automatically
  set upstream tracking





* *******************************************************************************************************
* Git Reference
* *******************************************************************************************************
  https://git-scm.com/
* *******************************************************************************************************




* *******************************************************************************************************
* Github accounts :
* *******************************************************************************************************
  https://docs.github.com/en/github/getting-started-with-github/types-of-github-accounts
* *******************************************************************************************************


* ******************************************
git clone <sshurl/newrepo.git>
cd newrepo

git status

git remote -v

git checkout -b newbranch

git config --global push.default simple

git push --set-upstream origin newbranch

****
(now in new location)

git clone <sshurl/newrepo.git>

cd newrepo

git status

git remote -v

git checkout newbranch


***

use "get push" and "get pull" as needed

***


https://help.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line


 2043  git fetch origin
 2044  git checkout origin/master -- greg.cpp



https://git-scm.com/docs/user-manual#git-quick-start


Basically, just do a 
  git pull --dry-run
  git push --dry-run

  git push -u origin master


*********************************************
 2204  cp -r ~/wwmax .
 2205  cd wwmax
 2207  git init
 2208  git status
 2209  git add .
 2210  git status
 2211  git commit -a -m "initial maxima"
 2218  git remote add origin https://github.com/gregwarwar/wwmax.git
 2220  git push -u origin master

 From now on, I think you should just have to do the commit and the push
*********************************************

Nice Article on cleaning up a git repostitory :

  https://www.shellhacks.com/git-remove-all-commits-clear-git-history-local-remote/


git checkout --orphan temp_branch

git add -A

git commit -am "The first commit"

git branch -D master

git branch -m master

git push -f origin master

*********************************************