How to fetch all Git branches

You can fetch all branches from all remotes like this: It’s basically a power move. fetch updates local copies of remote branches so this is always safe for your local branches BUT: fetch will not update local branches (which track remote branches); if you want to update your local branches you still need to pull … Read more

Undoing a git rebase

The easiest way would be to find the head commit of the branch as it was immediately before the rebase started in the reflog… and to reset the current branch to it (with the usual caveats about being absolutely sure before reseting with the –hard option). Suppose the old commit was HEAD@{2} in the ref … Read more

Is it safe to download code from GitHub?

As with anything you download over the internet, there could be malicious stuff when you download anything, some antivirus quickscan keep novices happy, most do automatically nowadays as people use the files. When you do compile it and run it, well, it is assumed you KNOW what the program is when you compile you will … Read more

Could not open a connection to your authentication agent

You might need to start ssh-agent before you run the ssh-add command: Note that this will start the agent for msysgit Bash on Windows. If you’re using a different shell or operating system, you might need to use a variant of the command, such as those listed in the other answers. See the following answers: ssh-add complains: Could not open a … Read more

Gitignore not working

The files/folder in your version control will not just delete themselves just because you added them to the .gitignore. They are already in the repository and you have to remove them. You can just do that with this: Remember to commit everything you’ve changed before you do this! This removes all files from the repository and … Read more