TEXT
24
git howto
Guest on 24th January 2023 02:02:03 PM
IFC:
cvsup
git-ls-files -d | xargs git-update-index --remove
git-ls-files -o | xargs git-update-index --add
git-ls-files -m | xargs git-update-index
git-commit -m "IFC @ `date`"
Go to a certain tag/commit:
git checkout -b newbranch
git reset --hard <commitid>
Merge from "master" branch:
git merge "commit message" HEAD master
# or
git pull . master
# If there are conflicts:
vi conflicting_file
git-update-index conflicting_file # add to index when resolved
git commit
Rebase current branch to "master" branch:
# This reapplies the patches in the current branch to the top of
# master.
git rebase master
Silently get rid of a commit:
git rebase --onto badcommit^ badcommit branchname
git push remote-repo +branchname
Push changes in a branch to a remote repository:
git push remote-repo branchname
Pull changes from a remote branch:
git pull remote-repo branchname
Look at a file at a specific commit:
git ls-tree <commitid>
(keep using ls-tree on the ids of the subtrees until desired file is
reached)
git show <id>