SELECT Post FROM Stack Overflow Questions WHERE Topic = "git" ORDER BY Votes DESC;

Megan Risdal - Aug 30 '19 - - Dev Community

Recently, one of my friends, Jamie Hall, wrote a really great, practical tutorial titled "Get good at git". In it, he introduces the basic workflows you need to know to use the version control system everyone "loves to be hated by" (his joke, not mine). Not only is it a lovely introduction to git, this paragraph really resonated with me:

In practice, everyone [screws] up constantly. I’m talking about professional software engineers, with many years’ experience, totally [screwing] up their work through unforced errors and dumb mistakes.

Problems with git are so common that Katie Sylor-Miller created a website explaining how to get out of a specific git mess in plain English.

Knowing that the best place to find reassuring company with other developers totally screwing things up is Stack Overflow, I decided to have a look at the all-time top questions by votes to see how common git problems are. And it turns out that 5 of the top 10 most voted questions are about getting help with git.

If you've come across one of these questions (I know I have), you are very far from alone! I used DEV's new Stack Overflow liquid tag to embed the top git questions of all-time on Stack Overflow. Plus, on Stack Overflow you can now also click "share" and select "DEV" on any post.

#2 most upvoted question

I accidentally committed the wrong files to Git but didn't push the commit to the server yet.

How can I undo those commits from the local repository?

The only way seems to be to copy the edits in some kind of GUI text editor, then wipe the whole local…

#3 most upvoted question

I want to delete a branch both locally and remotely.

Failed Attempts to Delete a Remote Branch

$ git branch -d remotes/origin/bugfix
error: branch 'remotes/origin/bugfix' not found
$ git branch -d origin/bugfix
error: branch 'origin/bugfix' not found.

$ git branch -rd origin/bugfix
Deleted remote branch origin/bugfix (was 2a14ef7).

$ git

#4 most upvoted question

What are the differences between git pull and git fetch?

#8 most upvoted question

How do I undo 'git add' before commit?

10448

I mistakenly added files to Git using the command:

git add myfile.txt

I have not yet run git commit. Is there a way to undo this, so these files won't be included in the commit?

#9 most upvoted question

How do I rename a local Git branch?

10369

I don't want to rename a remote branch, as described in Rename master branch for both local and remote Git repositories.

How can I rename a local branch which hasn't been pushed to a remote repository?

In case you need to rename a remote branch as well:
How do

What about you?

Are there Stack Overflow questions about git you constantly reference? What are your biggest git hangups? Have you ever had any "oh crap" moments with git?

. . . .
Terabox Video Player