Alex Susanu

Git

remove last commit from local

git reset --hard HEAD~

error when trying to git push

>_ gph

fatal: The current branch <feature-branch> has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin  <feature-branch>

To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.

to fix:

git config --global --add --bool push.autoSetupRemote true

or edit the .gitconfig file in $HOME

# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
        name = <name>
        email = <email>
[push]
        autoSetupRemote = true # <--- add this line