[git-users] Updating a cloned repository

2010-07-30 Thread DAZ
Hi,

I have only used git for basic stuff, so I hope this makes sense

Say I create a very small CSS framework and put it in a git
repository.

If I want to use the framework in a new website, then I think the best
way is to clone the git repository, so there is a copy of the
framework in the website's directory.

What happens if I update the CSS framework and want the website to
have the most recent version - is there a git command that I could run
that would update all the files in the cloned repository?

I'm not sure I'd want to do this, but what if I improved the cloned
version and wanted these changes in the original?

Sorry if these are really basic questions!

Thanks,

DAZ

-- 
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.



[git-users] Re: Updating a cloned repository

2010-07-30 Thread Konstantin Khomoutov
On Jul 30, 5:36 pm, DAZ daz4...@gmail.com wrote:

 I have only used git for basic stuff, so I hope this makes sense

 Say I create a very small CSS framework and put it in a git
 repository.

 If I want to use the framework in a new website, then I think the best
 way is to clone the git repository, so there is a copy of the
 framework in the website's directory.

 What happens if I update the CSS framework and want the website to
 have the most recent version - is there a git command that I could run
 that would update all the files in the cloned repository?

 I'm not sure I'd want to do this, but what if I improved the cloned
 version and wanted these changes in the original?

You do `git pull` in the cloned repository. See the git-pull man page.

 Sorry if these are really basic questions!
Yes, the question is basic; reading a book on Git is advised. Or at
least a lengthy tutorial.

-- 
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.



[git-users] Re: git push to different branches

2010-07-30 Thread Konstantin Khomoutov
On Jul 28, 10:00 pm, joe ehass...@gmail.com wrote:

 When going through several articles/tutorials about git I see the
 following being done for the initial push to a new branch:

 git push origin branchname:refs/heads/branchname

 Is this necessary for subsequent pushes or does git push do the same
 thing?  I just tested this with a couple of dummy repo's and it seems
 to do the same thing.  I've actually been doing this each time I need
 to add/push something new to branches that aren't touched by
 developers:

 ** add files **
 git add .
 git commit -am added foo
 git push origin branchname:refs/heads/branchname

 ** checkout branch that is worked on and pull new data from branchname
 **
 git checkout devbranch
 git pull . branchname
 git push origin devbranch:refs/heads/devbranch

 So, if anyone could clarify this for me that would be awesome :)

First, the refs/heads/ prefix is superficial for most cases and is
only really needed when you have ambigous names (say, tag names
clashing with branch names). See the SPECIFYING REVISIONS section in
git-rev-parse manual page for the precise description of how such an
unprefixed name is revolved.
In other words, you usually just do `git push origin
devbranch:devbranch`.

Second, in most cases you will also omit the part after : (and the
colon itself) because if you do this, the destination ref name is
assumed to be the same as source. In other words, this usually can be
stripped down to `git push origin devbranch`.
Both refspecs are only needed when you want to update a remote ref
with a local ref which has different name, say, you fetched branch
foo from the remote, forked a local branch bar off it, made
several commits on it and then want to update the remote foo with
the fresh stuff in bar; in this case you do `git push origin
bar:foo`.

About the second question: no, nothing is saved automatically (which
is good).
On the one hand, you should be careful about what you push and so
naming refs explicitly is good, not hard. On the other hand, if you
need mirror mode, just use --mirror or other means. git-push
manual is your friend; read in thoroughly.
Also you can modify the behaviour of push in some ways, see
push.default parameter and parameters starting with branch. in git-
config manual.

-- 
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.