CommonThread - Our Blog

Recent Articles

Cherry-Pickin' in Git

Cherry-Pickin' in Git

Written By: Ben Wyrosdick

April 19th, 2008

if you are trying to update to a specific commit of a git repository and can’t seem to get git pull to allow you pull that specific commit, that is because it doesn’t work that way. so you type git to see what command are available but it only shows you these common commands none of which are useful for this:

usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate|--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find the change that introduced a bug by binary search
   branch     List, create, or delete branches
   checkout   Checkout and switch to a branch
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG

What you need is git cherry-pick which allows you to update to a specific commit.

usage: git-cherry-pick [options] <commit-ish>

    -n, --no-commit       don't automatically commit
    -e, --edit            edit the commit message
    -x                    append commit name when cherry-picking
    -r                    no-op (backward compatibility)
    -m, --mainline <n>    parent number

git cherry-pick will do a fetch and merge to any commit object and then do an auto commit for you. It will automatically use the commit message of that the select commit object. IF you wish to use a different message use the -e option.

2 Responses to “Cherry-Pickin' in Git”

  1. SweakBresee Says:
    I am going to be getting a new desk for my home office. What do you think of this professional desk? Spouse and I can not agree on desk for home office. [URL=http://www.officefurniturelocators.com/][IMG]http://www.officefurniturelocators.com/sites/default/files/imagecache/product-thumb/desk1-pic1.jpg[/IMG][/URL] I think it is a wonderful looking desk but my partner doesn't believe so. What do you guys guess? It is used and a quality desk for a professional office, but my partner wishes for a new one from Walmart. What do you all guess? Here is a link to the desk: [URL=http://www.officefurniturelocators.com/used-office-furniture-houston]Used Office Furniture Houston[/URL] Thank you everyone for all of your support!
  2. Suimmizinible Says:
    [IMG]http://edhardyshop.com/resources/edhardyshop.com/images/logo.gif[/IMG] [B]ed hardy uhren[/B] liebt Erfolg. Bevor er mit [B][URL=http://www.edhardyclub.com]ed hardy schuhe[/URL][/B] weltbekannt wurde, französische noch 4 anderen und seinen Ideen zu einem festen Platz im Fashion-Himmel: und. Doch sich ihm alles die Tattoo-Style. Immer seinem, und of Tattoo [B]ed hardy de[/B] macht er stark Herzen, Totenköpfen Tigern bekannt. Körper-Kunst Tätowierers inspirierte Jahren erst Labels. Bekannt wurde [B][URL=http://www.edhardyclub.com]ed hardy outlet[/URL][/B] mit kostspieligen, aber Marketing-Methode: Mehrmals in die und, was gefällt. So machte Britneys Spears eine den [B][URL=http://www.edhardyclub.com]ed hardy uhren[/URL][/B] und erleichterte Hunderttausend. Selbst das deutsche Top-Model Klum von dem [B][URL=http://www.edhardyclub.com]ed hardy[/URL][/B] Style und deshalb kaum Staffel von Germany's Next Topmodel, in der die angehenden von Christian Audigier für gecastet werden. In der aktuellen 3. Staffel letzten 4 Kandidatinnen einen der Brand und Bill [B]ed hardy uhren[/B] in zu sein.Mit bodenständigem und krachendem Rock'n [B]ed hardy de[/B] Roll in den Label und schickt nun [B][URL=http://www.edhardyclub.com]ed hardy de[/URL][/B] in den brands4freinds Onlien Shop. Vom 29. bis 31. Mai. alle den Roll-Style von Ed Hardy kaufen. Reduzierte Preise Ehrensache. Wer jetzt kein ist, von und mit ein Glück man sich im Shopping-Club von brands4friends und [B][URL=http://www.edhardyclub.com]ed hardy günstiger[/URL][/B] ist der Hardy-Shoes-Aktion mit dabei.

Leave a Reply