- git remote prune origin –dry-run
- (Local) git branch -d <localbranch>
I recently ran into an issue – after downloading my c# project from github, i could not build the project. basically on compilation, the project was complaining saying there were missing references and such.
It seemed the problem was because VS was assuming that the packages are there, so it was avoiding downloading the packages again. However, the content inside the ‘packages’ folder was not complete – aka .dlls were missing from the packages folder because there had been git-ignored.
It seems I had not done the gitignore properly ! In the references below, there is an example of how to gitignore VS projects properly.
<snip> # NuGet Packages *.nupkg # The packages folder can be ignored because of Package Restore **/packages/* # except build/, which is used as an MSBuild target. !**/packages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/packages/repositories.config # NuGet v3's project.json files produces more ignoreable files *.nuget.props *.nuget.targets </snip>
I recently had to figure out how to save my git credentials, so i wouldn’t have to keep typing them repeatedly.
The references below helped me get past the issue. Some notes below:
$ git help credentials. <--Read this! Very Useful
 First note that there is a difference between ‘revert’ and ‘reset’
 Undoing a ‘git add’ before doing a ‘git commit’
Note: For this scenario, most of the above links are recommending doing a ‘git reset’. There is a difference between a ‘soft’ reset and a ‘hard’ reset.
 Recently I had to undo a commit I had made into my local git repo. I was under the impression that reverting commits in Git is a big hassle. To my surprise, it didn’t prove to be too much of a pain. These are things I had to do basically:
couple of git reset --soft HEAD~ commands (because there was stuff I had pulled into my repo after commiting)
That was it! I got my repo back to sanity.
 Another import task is to view unpushed git commits. this is an important thing to do, especially before making commits into a remote branch.