Skip to content

Instantly share code, notes, and snippets.

@misTrasteos
Last active April 13, 2022 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misTrasteos/b9c9883a5eb4a016ba20bfebf8f3b080 to your computer and use it in GitHub Desktop.
Save misTrasteos/b9c9883a5eb4a016ba20bfebf8f3b080 to your computer and use it in GitHub Desktop.
GIT

Install latest version

Ubuntu

sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git

commit

empty commits

git commit --allow-empty -m "first empty commit"

Undoing

Last commit

git reset --soft HEAD~1

squash all commits

git rebase -i --root

First commit -> pick. Rest of commits -> squash

ssh

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/key

GitHub Cli

Create a local existing repo

$ gh repo create
? What would you like to do? Push an existing local repository to GitHub
? Path to local repository .
? Repository name nginx-upstream-example
? Description Playing with Nginx
? Visibility Public
✓ Created repository misTrasteos/nginx-upstream-example on GitHub
? Add a remote? Yes
? What should the new remote be called? origin
✓ Added remote git@github.com:misTrasteos/nginx-upstream-example.git
? Would you like to push commits from the current branch to the "origin"? Yes
✓ Pushed commits to git@github.com:misTrasteos/nginx-upstream-example.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment