TEXT   24

git howto

Guest on 24th January 2023 02:02:03 PM


  1. IFC:
  2.         cvsup
  3.         git-ls-files -d | xargs git-update-index --remove
  4.         git-ls-files -o | xargs git-update-index --add
  5.         git-ls-files -m | xargs git-update-index
  6.         git-commit -m "IFC @ `date`"
  7.  
  8. Go to a certain tag/commit:
  9.         git checkout -b newbranch
  10.         git reset --hard <commitid>
  11.  
  12. Merge from "master" branch:
  13.         git merge "commit message" HEAD master
  14.         # or
  15.         git pull . master
  16.  
  17.         # If there are conflicts:
  18.         vi conflicting_file
  19.         git-update-index conflicting_file # add to index when resolved
  20.         git commit
  21.  
  22. Rebase current branch to "master" branch:
  23.         # This reapplies the patches in the current branch to the top of
  24.         # master.
  25.         git rebase master
  26.  
  27. Silently get rid of a commit:
  28.         git rebase --onto badcommit^ badcommit branchname
  29.         git push remote-repo +branchname
  30.  
  31. Push changes in a branch to a remote repository:
  32.         git push remote-repo branchname
  33.  
  34. Pull changes from a remote branch:
  35.         git pull remote-repo branchname
  36.  
  37. Look at a file at a specific commit:
  38.         git ls-tree <commitid>
  39.         (keep using ls-tree on the ids of the subtrees until desired file is
  40.         reached)
  41.         git show <id>

Raw Paste


Login or Register to edit or fork this paste. It's free.

">