Skip to content

remote

# Show information about remotes
git remote
git remote -v # verbose

add

# Add/remove remote
git remote add "remote-name" "remote-uri" # Name is usually origin
git remove add "origin" "[email protected]:hvitoi/docs.git"
git remove add "localorigin" "~/docs/"

remove

git remote remove "remote-name" "remote-uri"

show

# Show specific remote
git remote show "remote" # This command fetches metadata from remote
git remote show "origin"

prune

# Remove from remote the things deleted locally (E.g., branches)
git remote prune "remote"

update

# Remove from local the things deleted remotely (E.g., branches)
git remote update "remote" --prune

set-url

git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'

git remote set-url "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/..."

git add ./\*.tf
git commit -m blabla && git push || echo "Nothing to commit"