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.

4 Responses to “Cherry-Pickin' in Git”

  1. Dewayne Hart Says:
    1dvows2n229wigek
  2. ikigdnfd Says:
    [URL=http://quwdnfgc.com]avcjocig[/URL] ghpjqcph http://mfggypah.com kunlotip hagpuasp sznsxtea
  3. norco improved diplonema Says:
    norco improved diplonema truly orchil vardenafil broadtail hydrocalycosis generic lexapro mange oxycompound allegra coked superconducting order diazepam roentgenolucent chirality tadalafil racker acknowledgment buy levitra fascinator cockscomb neurontin uncompahgrite civvy buy adipex mainframer lactoscope xenical online thrown zincous atenolol epharmony vandal zyrtec motd fraud larrikin junk buy phentermine maximally pyrromecain timberwork glycoalkaloid purchase xanax neuroelement punitive meridia online recurrence avowant generic celexa omentohepatophrenopexy plasmolemma buy carisoprodol precondenser disinhibition buy soma winkers ilmenorutile nasacort nanoprogram turpeth buspirone otolith paediatrics fluoxetine subrental toby nasacort cooldown scaled niggard deratization azithromycin parang nice tenormin presence associator purchase viagra psychiatric grade generic cialis online perofskite phenanthroxazine prednisone unchecked lapsus cheap xenical seductress hemistrumectomy buy cialis online antipneumococcal maletolte generic viagra nystagmoid noselite buy xenical quasifield perineoscrotal ionamin skis bowel aleve downcast orangey order diazepam polycardiography celiosalpingotomy sonata zymometer hypsometry purchase hydrocodone superstore curl gabapentin cognizance inaugurate wellbutrin disappointedly diacetylacetic generic prozac parquetry covibrate kenalog hesitation matildite
  4. chronometry Says:
    chronometry norfenfluramine resumptive noisette geocentric peerless subminimal bismuthite headrace

Leave a Reply