PostgreSqlStan / git-practice

trying git commands on a disposable repo.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git-practice

trying git commands on a disposable repo.

BTW, if you're here trying to understand git better, I highly recommend this lecture:

Remove all history

I've used this method a couple of time to create a clean, pruned repo: Clearing Git History in Local and Remote Branches

[edited: changed "master" to "main"]

git checkout --orphan tmp-main # create a temporary branch
git add -A  # Add all files and commit them
git commit -m 'Add files'
git branch -D main # Deletes the master branch
git branch -m main # Rename the current branch to master
git push -f origin main # Force push master branch to Git server

Then finish the local cleanup:

git branch --set-upstream-to=origin/main main # Local master tracks origin/master
git gc --aggressive --prune=all # remove the old files

orphan asset branch

Storing image assets in your repo and referencing in markdown

git checkout --orphan assets
git reset --hard
cp ~/Documents/fav_photo/nap-time.jpeg
git add .
git commit -m 'Added cat picture'
git push -u origin assets

* 78b11b3 (HEAD -> assets, origin/assets) Added cat picture - PostgreSqlStan, 23 seconds ago

cat pic?

About

trying git commands on a disposable repo.

License:The Unlicense