git config --global user.name "Prename Name"
git config --global user.email "[email protected]"
Just remove the --global
flag for local setup.
git clone https://[email protected]/user/repo.git
cd repo
touch README.md
git add README.md
git commit -m "add README"
git push -u origin main
cd existing_folder
git init
git remote add origin https://[email protected]/user/repo.git
git add .
git commit
git push -u origin main
cd existing_repo
git remote add origin https://[email protected]/user/repo.git
git push -u origin --all
git push -u origin --tags
git remote rm origin
git remote add origin <new-location>
git branch --set-upstream-to=origin/main main
git update-index --assume-unchanged [path]
To update a local clone of a repository whose default branch name was changed (e.g. from master
to main
):
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
Caution: this will store the password unencrypted on the disk! Only use if it's safe on your machine!
git config credential.helper store
Use git commit -S
by default for all commits
git config --global commit.gpgsign true
Set default key
git config --global user.signingkey <key-id>
In case GPG failed to sign data
export GPG_TTY=$(tty)
git tag -a v[version] [hash] -m "your tag description"
git log $(git describe --tags --abbrev=0)..HEAD --oneline
git branch -d local-branch-name
git remote prune origin
Pull all submodules of the current repository (as they will not automatically retrieved by a git clone
)
git submodule update --init --recursive