% git tag '0.1-demo' -m "Proof of concept demo for initial App47 distribution"Adds the tag, with the given comment.
To push the tag up to github (or wherever)
% git push --tags
git branch -D protocol-play
(the capital D if you don't care about the merged status). You might need to git push
. too.
It's gone locally, but still exists up on github. Nuke it there with:
% git push origin :protocol-play
git add
to stage a change, but now you want to see what that was. Use
% git diff --cached
git log [options] [--] [path]
-p
— show the diff (patch)
-#
— limit output (e.g. -23
to last 23 entries)
--since / --until
— commits more recent (or older) than given date
--stat
— abbreviated stats (adds/deletes, modified files)
--pretty=thing
— Make output pretty. Things include oneline, short, medium, full, fuller, (no fullest), email, raw, format:, tformat:--graph
— draw those funky git branch gtaphs
--author / --committer
— filter on specific dude / dudette
--grep
— filter on keywords in commit messages
--all-match
— Turn multiple predicates from OR into AND
Format Options
%H / %h
— hash (shortened)
%T / %t
— tree hash (shortened)
%P / %p
— parent hash (shortened)
%an / %ae / %ad / %ar
— Author name, email, date (relative)
%cd / %ce / %cd / %cr
— Committer name, email, date (relative)
%n
— newline
Date format can be specific (1961-01-13), or relative ("4 years 23 months"). Can replace spaces with dots: 4.years.23.months. The actual format is undocumented (OF COURSE), but you can look at the approxidate code.
% git reset --soft "HEAD~1"
git branch markd-dev git push -u origin markd-dev
% git tag -d release-cg-pt3 % git push origin :refs/tags/release-cg-pt3 % git status % git tag release-cg-pt3 7f05a3de66 % git push origin master --tagsAnd the go to your github release page. It should say that the release has become a draft (due to the tag change). Edit it and republish it.
% git tag --force '0.1-demo' -m "pithy comment" And if you're using github or something % git push --tags
If your current checkout is via https (you can figure that out by doing git config -l
(ell) and looking at the remote.origin.url
). If it's https
it's not going to use your ssh keys. You'll need to change it.
If it was originally:
remote.origin.url=https://github.com/someuser/GroovyProject.git
You'd do:
% git config remote.origin.url git@github.com:someuser/GroovyProject.git
% git remote prune --dry-run originTo see what'll get removed, and then
% git remote prune originTo clean things out.
git push
tries to push all the branches, sometimes eliciting this wonderful response:
error: failed to push some refs to 'git@github.com:bignerdranch/roominant.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. If you did not intend to push that branch, you may want to hint: specify branches to push or set the 'push.default' configuration hint: variable to 'current' or 'upstream' to push only the current branch. hint: you might as well just give up. neener neener neener. love, GitSo you can tell git to only push the currently active branch:
% git config --global push.default current
git diff
shows changes made since the file was last staged. If you make changes, stage them, then make more changes, this only shows you the more changes
git diff --staged
shows changes made to the file when it was staged, diffs against the committed version it's based off of. It doesn't include any changes you've made since staging.
git diff HEAD
(where HEAD is the name of a commit - HEAD to compare with the latest commit, or a branch name to compare to the tip of that branch. In essence, unions git diff
and git diff HEAD
git reset --soft HEAD~1
% git checkout filename-to-revertThis checks the file out from HEAD, removing the local modificaiton. (put
--
before the file name in case you have a branch named the same as the file)