Advertisement
bigrushdog

git cheatsheet

Jul 22nd, 2011
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.52 KB | None | 0 0
  1. REMOTES
  2.  
  3. git remote add coolbho https://github.com/coolbho3k/Xoom-OC.git
  4. git remote add cyber https://github.com/cybertronic/Xoom-OC.git
  5. git remote add kcrudup https://github.com/kcrudup/Xoom-OC-CP.git
  6. git remote add tegra git://android.git.kernel.org/kernel/tegra.git
  7. git remote add common git://android.git.kernel.org/kernel/common.git
  8. git remote add aufs http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git
  9. git remote add nvidia http://nv-tegra.nvidia.com/gitweb/?p=linux-2.6.git
  10. git remote add tdr git://github.com/TDR/Xoom.git
  11.  
  12. CLONE REPO
  13. git clone https://bigrushdog@github.com/Tiamat-AOSP/Xoom-OC.git
  14.  
  15. CREATE NEW BRANCH
  16. git checkout -b bigrushdog-exp
  17.  
  18. CHANGE BRANCH
  19. git checkout bigrushdog-exp
  20.  
  21. VIEW ALL BRANCHES
  22. git branch -a
  23.  
  24. ADD REMOTE SOURCE
  25. git remote add cyber https://cyber@github.com/Tiamat-AOSP/Xoom-OC.git
  26.  
  27. REMOVE REMOTE BRANCH
  28. git push origin :cybertronic-android-tegra-2.6.36-honeycomb
  29.  
  30. REMOVE LOCAL BRANCH
  31. git brand -D local_branch
  32.  
  33. STAGE REMOTE FOR CHERRYPICKING
  34. git fetch cyber
  35.  
  36. PULL REMOTE BRANCH
  37. git checkout cyber (change to desired local branch)
  38. git pull cyber cyber-branch (pull into desired branch)
  39.  
  40. CHERRYPICK A COMMIT
  41. git cherry-pick <commit tag>
  42.  
  43. FIX PULL ERRORS
  44. >>>>>>>>>>>>>>>>>>>>>>>>>>>
  45. HEAD
  46. then some code      THIS IS BEFORE PULL, DELETE
  47. then
  48. =================
  49. some more code      THIS IS AFTER PULL, KEEP
  50. <<<<<<<<<<<<<<<<<<<<<
  51.  
  52. COMMIT
  53. git checkout desired-branch
  54. git add 'drop file here'
  55. git commit -m 'commit message here'
  56. git push origin desired-remote-branch
  57.  
  58. MERGE PULL REQUEST
  59. git checkout -b cybertronic-android-tegra-2.6.36-honeycomb android-tegra-2.6.36-honeycomb
  60. git pull https://github.com/cybertronic/Xoom-OC.git android-tegra-2.6.36-honeycomb
  61. git checkout android-tegra-2.6.36-honeycomb
  62. git merge cybertronic-android-tegra-2.6.36-honeycomb
  63. git push origin android-tegra-2.6.36-honeycomb
  64.  
  65. GIT STASH
  66.  
  67. Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.
  68.  
  69. The modifications stashed away by this command can be listed with git stash list, inspected with git stash show, and restored (potentially on top of a different commit) with git stash apply. Calling git stash without any arguments is equivalent to git stash save. A stash is by default listed as "WIP on branchname …", but you can give a more descriptive message on the command line when you create one.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement