Microblogi: A very long article Wikipedia article on the orientation of toilet paper [7. kes klo 22:52] [V]

Maanantai, 14. toukokuuta 2012

More Git Recipes

Käännös: [ Google ]

Kategoriat: [ ATK/Git ]

Resolve a binary file conflict with Git

Found on lostechies.com

In case of conflict with a binary file during a merge, you have two choices for resolving it:

  • Use your own version:
    git add thefile
  • Use the other version:
    git checkout --theirs -- thefile; git add thefile

Then commit the changes.

Show the content of a deleted file

Found on stackoverflow.com

git show commitid:path/to/file

The trick here is that one must use the full path to the file (relatively to the repository's root)

Restore a deleted file in a Git repo

Found on stackoverflow.com

Find the last commit where the file was deleted:
git rev-list -n 1 HEAD -- thefile
Then checkout the file from the commit before that:
git checkout commitid -- thefile

[ Postattu 14. toukokuuta 2012 klo 13.39 | ei kommenttia | ]

Trackback osoite

https://weber.fi.eu.org/blog/Informatique/Git/more_git_recipes.trackback

Kommentit

Ei kommenttia

Lisää kommentejä

Voit käyttää seuraavat HTML tagit: <p>, <br>, <em> <strong>, <pre>. URL:t jotka alkaavat http://-lla muuttuvat automatisesti hyperlinkkeiksi.

(harkinnanvarainen)
(harkinnanvarainen)


Tallena nimeni ja URL/s-posti ensi kerralle

18 / 3 =