What is Git pruning?

“Prune remote branches” in Git Extensions executes git remote prune command, which removes your local remote tracking branches where the branch no longer exists on the remote. See here: https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-empruneem

How do I clone a specific Git branch? [duplicate]

The –single-branch option is valid from version 1.7.10 and later. Please see also the other answer which many people prefer. You may also want to make sure you understand the difference. And the difference is: by invoking git clone –branch <branchname> url you’re fetching all the branches and checking out one. That may, for instance, … Read more

git stash apply version

The keys into the stash are actually the stash@{n} items on the left. So try: (note that in some shells you need to quote “stash@{0}”, like zsh, fish and powershell). Since version 2.11, it’s pretty easy, you can use the N stack number instead of using stash@{n}. So now instead of using: You can type: To get list of … Read more

git error: failed to push some refs to remote

(Note: starting Oct. 2020, any new repository is created with the default branch main, not master. And you can rename existing repository default branch from master to main.The rest of this 2014 answer has been updated to use “main“) (The following assumes github.com itself is not down, as eri0o points out in the comments: see www.githubstatus.com to be sure) If the GitHub repo has seen new commits pushed to it, while … Read more

Git: How do I force “git pull” to overwrite local files?

⚠ Important: If you have any local changes, they will be lost. With or without –hard option, any local commits that haven’t been pushed will be lost.[*] If you have any files that are not tracked by Git (e.g. uploaded user content), these files will not be affected. First, run a fetch to update all origin/<branch> refs to latest: Backup your … Read more