[git-users] Re: list files under tag ???

2009-12-12 Thread Konstantin Khomoutov
On Dec 12, 11:04 am, SCM Admin  wrote:

> Just one more thing to add here. How do i tag the whole content inside my
> branch? As paul said, if i do 10 commits only the final commit will be
> tagged. Now for example if i will branch-off from the master branch and
> start work from there and i want to give a final tag on the branch what i am
> working till now. Is it possible in GIT ?

This is not needed. Here's why: each commit in a repository managed by
Git
knows its immediate parent commit(s) -- one for simple changeset and
two or more for commits resulted from merging.
Hence, if you khow the name of any commit in the history, you can
easily
trace the full history of changes that commit resulted from.

Now let me guess about why you asked...
Note that Git it radically different from, say, Subversion in that you
do
not usually operate on changesets (well, in 1.5.x Subversion moved a
bit
in the same direction as Git though), that is, merging developments
made on a branch back to the trunk do not require you to find out
where
your branch forked off, you just do
$ git checkout master
$ git merge mybranch
and Git figures out all by itself what to merge to make master have
all the
changes made in the mybranch (compared to master).

To get more familiar with concepts in Git, consider reading [1] (and
the material
it refers to) and [2].

> Also how do i see the content inside a commit? if i run "git log " it just
> shows the commit id and the author.
Did you read git log manual page at all?
try running `git help log`.
Also using some GUI tool might help, try gitk for instance.

1. http://tom.preston-werner.com/2009/05/19/the-git-parable.html
2. http://progit.org/

--

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.




Re: [git-users] list files under tag ???

2009-12-12 Thread Paul Beckingham
> Just one more thing to add here. How do i tag the whole content inside my 
> branch? As paul said, if i do 10 commits only the final commit will be 
> tagged. Now for example if i will branch-off from the master branch and start 
> work from there and i want to give a final tag on the branch what i am 
> working till now. Is it possible in GIT ?


Hi Vijay,

Yes, this is possible in git, and easy too.  Here's an example (without the 
response from git, for clarity):

First make a repo, make one commit on master and tag it

$ git init foo
$ cd foo
$ date > file
$ git add file
$ git commit -m one
$ git tag -a FIRST -m FIRST

Now create a branch, two commits, and tag the HEAD of the branch

$ git checkout -b dev
$ date > file; git commit -a -m two
$ sleep 1; date > file; git commit -a -m three
$ git tag -a SECOND -m SECOND

Now look at the log

$ git log --oneline --decorate
f28c7ce (tag: SECOND, dev) three
91dc711 two
db9c558 (tag: FIRST, master) one

Notice the two tags, and the different branches they are on.  Your tree now 
looks like this:

o master (FIRST)
 \
  o---o dev (SECOND)


> Also how do i see the content inside a commit? if i run "git log " it just 
> shows the commit id and the author.

Try

$ git log -p

to show you the patches as well as the commit message, committer, sha1 etc.
or

$ git show 

to show you a specific commit with message, committer, sha1 etc.

Paul.

--

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.




Re: [git-users] list files under tag ???

2009-12-12 Thread SCM Admin
Just one more thing to add here. How do i tag the whole content inside my
branch? As paul said, if i do 10 commits only the final commit will be
tagged. Now for example if i will branch-off from the master branch and
start work from there and i want to give a final tag on the branch what i am
working till now. Is it possible in GIT ?

Also how do i see the content inside a commit? if i run "git log " it just
shows the commit id and the author.

Thanks in advance.

~Vijay.

On Mon, Dec 7, 2009 at 11:49 AM, Alan Hawrylyshen  wrote:

>  Perhaps another clarification: A commit is not just the files modified by
> that commit but the state of the whole working view / repository at that
> commit. That was an "a ha!" moment for me.
>
> Alan
>
> Sent from my mobile device.
>
> On Dec 6, 2009, at 21:56, Paul Beckingham  wrote:
>
>  Vijay,
>
> If you make 10 commits, then tag the 10th commit, then that tag only
> applies to that last commit.  The tag does not apply to commits 1 through 9,
> nor does that tag apply to an 11th commit.  Just the one.  It's really no
> different to other systems, although it might sounds like it is.  You would
> expect to tag a certain file version, but not the earlier or later version.
>  Git just doesn't do files - it does changesets (commits).
>
> Take a look at this (you could try it yourself):
>
>  $ git init tagtest
> Initialized empty Git repository in /home/paul/tagtest/.git/
> $ cd tagtest
> $ date > file
> $ git add file
> $ git commit -m "zero"
> [master (root-commit) 815ce88] zero
>  1 files changed, 1 insertions(+), 0 deletions(-)
>  create mode 100644 file
> $
> $ date >> file; git commit -a -m one
> [master 921ae3e] one
>  1 files changed, 1 insertions(+), 0 deletions(-)
> $
> $ date >> file; git commit -a -m two
> [master *5f30367*] two
>  1 files changed, 1 insertions(+), 0 deletions(-)
> $
> $ date >> file; git commit -a -m three
> [master b256a7b] three
>  1 files changed, 1 insertions(+), 0 deletions(-)
> $
> $ date >> file; git commit -a -m four
> [master 77f0a1b] four
>  1 files changed, 1 insertions(+), 0 deletions(-)
> $
> $git tag -a Vijay -m Vijay *5f30367*
> $git log --oneline --decorate
> 77f0a1b (master) four
> b256a7b three
> *5f30367* (tag: Vijay) two
> 921ae3e one
> 815ce88 zero
>
> See how the tag only applies to that one (red, highlighted) commit?
>
>
>  maybe i am asking a basic question, sorry for my ignorance. :-(
>
>
> No no, absolutely not - this is just how it feels to learn git.
>
> Paul
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To post to this group, send email to git-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> git-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/git-users?hl=en.
>
>   --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To post to this group, send email to git-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> git-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/git-users?hl=en.
>

--

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.