Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Git Best Practices Guide

You're reading from   Git Best Practices Guide Master the best practices of Git with the help of real-time scenarios to maximize team efficiency and workflow

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher
ISBN-13 9781783553730
Length 102 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
PIDOUX Eric PIDOUX Eric
Author Profile Icon PIDOUX Eric
PIDOUX Eric
Arrow right icon
View More author details
Toc

Fixing errors by practical examples

This section will help the readers a lot because the errors mentioned can occur very frequently. This will summarize the entire chapter. Sometimes, especially when you are not really familiar with Git, you don't know how to fix it. Here are the most common errors that will occur:

  • Remote origin already exists: This error occurs when you already have a remote repository specified and the remote origin removed and added:
    Erik@server:~$ git remote rm origin
    Erik@server:~$ git remote add origin https://github.com/sexyboys/InflexibleBundle.git
    
  • Git push fails with rejected error: This error occurs because you didn't execute git pull before git push:
    Erik@server:~$ git pull
    Erik@server:~$ git push
    
  • Git push fails with "fatal: The remote end hung up unexpectedly": This one is common and you should check whether your remote URL is correct and Git has access to the remote repository.
  • Restoring a changed file to its last committed state: Run git checkout...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at R$50/month. Cancel anytime