commit   1980

« earlier    

Can you explain what "git reset" does in plain english? - Stack Overflow
The "strange notation" (`HEAD^` and `HEAD~1`) you mention is simply a shorthand for specifying commits, without having to use a hash name like 3ebe3f6. It's fully documented in the "[specifying revisions](http://www.kernel.org/pub/software/scm/git/docs/git-rev-parse.html#_specifying_revisions)" section of the man page for git-rev-parse, with lots of examples and related syntax. The caret and the tilde actually mean [different things](http://paulboxley.com/blog/2011/06/git-caret-and-tilde):

* `HEAD~` is short for `HEAD~1` and means the commit's first parent. `HEAD~2` means the commit's first parent's first parent. Think of `HEAD~n` as "n commits before HEAD" or "the nth generation ancestor of HEAD".

* `HEAD^` (or `HEAD^1`) also means the commit's first parent. `HEAD^2` means the commit's second parent. Remember, a normal merge commit has two parents - the first parent is the merged-into commit, and the second parent is the commit that was merged. In general, merges can actually have arbitrarily many parents (octopus merges).

* The `^` and `~` operators can be strung together, as in `HEAD~3^2`, the second parent of the third-generation ancestor of `HEAD`, `HEAD^^2`, the second parent of the first parent of HEAD, or even `HEAD^^^`, which is equivalent to `HEAD~3`.

https://web.archive.org/web/20170801041108/https://stackoverflow.com/questions/2530060/can-you-explain-what-git-reset-does-in-plain-english
https://archive.is/X8JDv
StackExchange  StackOverflow  git  commit  reference 
20 days ago by coffeebucket
PaulBoxley.com – Git caret and tilde
I spent a little bit of time playing with Git today, specifically the way that the ^ (caret) and ~ (tilde) work and thought I'd document it here in case I forget.

The short version

If you want a deeper explanation skip down to "The long version".

`ref~` is shorthand for `ref~1` and means the commit's first parent. `ref~2` means the commit's first parent's first parent. `ref~3` means the commit's first parent's first parent's first parent. And so on.

`ref^` is shorthand for `ref^1` and means the commit's first parent. But where the two differ is that `ref^2` means the commit's second parent (remember, commits can have two parents when they are a merge).

The ^ and ~ operators can be combined.

Here's a diagram showing how to reference various commits using HEAD as the starting point.

https://web.archive.org/web/20170801040748/http://www.paulboxley.com/blog/2011/06/git-caret-and-tilde
https://archive.is/rcL9i
git  reference  commit  diagram 
20 days ago by coffeebucket
ttskch/ghsync: Sync local git repository and remote GitHub repository automatically.
Sync local git repository and remote GitHub repository automatically.
git  commit  auto 
20 days ago by mdbraber
Package - git-auto-commit
A git auto commit tool, commit every several minutes
git  auto  commit 
20 days ago by mdbraber
How to view raw git commit information on Github | Flummoxed by IT
If you notice the URL of the webpage ends with the SHA1 hash of the commit. For example https://github.com/mxcl/homebrew/commit/97daedbd02cc5a744c63cfa092185bb1e6eb7b52

The trick to view the raw git commit log is to add ".patch" to the end of the URL, for example:

https://github.com/mxcl/homebrew/commit/97daedbd02cc5a744c63cfa092185bb1e6eb7b52.patch
GitHub  git  commit  patch  raw 
4 weeks ago by coffeebucket
Squash All Commits Related to a Single Issue into a Single Commit · ginatrapani/todo.txt-android Wiki
todo.txt-android - Official Todo.txt Android app for managing your todo.txt file stored in Dropbox.
commit  git  squash 
5 weeks ago by bwll
Auto-squashing Git Commits
Rebase like a pro with autosquash.
git  squash  rebase  commit 
5 weeks ago by bwll

« earlier