You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Divide 1 by 10, to get the time after which the the suggested command will be run. Config above sets a 0.1 second delay.
git psuh
WARNING: You called a Git command named 'psuh', which does not exist.
Continuing in 0.1 seconds, assuming that you meant 'push'.
👆🏽 git push will be run automatically after 0.1 seconds.
Automatically setup remote upstream branch for a new local branch
You must have seen this a lot when pushing your new branch to remote origin (GitHub, GitLab, BitBucket and such):
git push
fatal: The current branch new-branch has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin new-branch
To avoid copy-pasting the set upstream command, simply setup to auto setup remote in your global config. Like so:
git config --global push.autoSetupRemote true
Note this feature became available in git version 2.37 git/git@05d5775
Prune on Fetch
This configuration will automatically clean Git objects in your repository locally whenever you fetch changes from remote.
git config --global fetch.prune true
If this configuration is set, running git fetch will also run git remote prune afterwards. git remote prune will delete inaccessible Git objects in your local repository that aren’t on remote. Deleting branches on remote but not locally will generate these inaccessible Git objects.
Having this option enabled minimizes the number of branches I have on my local machine. Any autocomplete feature that uses this list of branches is much easier to use with limited branches hanging around.
Thanks to Andy Peterson of Atomic Object for this one. Source
Autocorrect git commands
Divide
1
by 10, to get the time after which the the suggested command will be run. Config above sets a 0.1 second delay.👆🏽
git push
will be run automatically after 0.1 seconds.Automatically setup remote upstream branch for a new local branch
You must have seen this a lot when pushing your new branch to remote origin (GitHub, GitLab, BitBucket and such):
git push fatal: The current branch new-branch has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin new-branch
To avoid copy-pasting the set upstream command, simply setup to auto setup remote in your global config. Like so:
git config --global push.autoSetupRemote true
Note this feature became available in git version 2.37 git/git@05d5775
Prune on Fetch
git config --global fetch.prune true
Thanks to Andy Peterson of Atomic Object for this one. Source
Setup your username and email for git
Check your git config
Local (current repository)
Global
More details on checking and setting git config in this Stackoverflow answer.
The text was updated successfully, but these errors were encountered: