adonthell-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-general] Re: [maybe slightly OT] Git pull origin master


From: Chris Frey
Subject: [Adonthell-general] Re: [maybe slightly OT] Git pull origin master
Date: Thu, 16 Dec 2010 16:50:18 -0500
User-agent: Mutt/1.4.2.2i

On Thu, Dec 16, 2010 at 02:16:21AM +0530, shirish ??????????????? wrote:
> Hi all,
> Few queries,
> 
> 1. I was going through the git help and saw
> 
> Updating a local branch from the remote server :-
> 
> git pull
> 
> It seems to function the same as your longer version on http://bit.ly/dMsY1F
> 
> run
>  git pull origin master
> from time to time to update your clone to the most recent version.
> 
> Perhaps you are doing that so that people shouldn't by mistake do
> something stupid, could you clarify ?

Some branches have links to upstream ones.  These are generally
branches like master (linked to origin/master) and branches that you
create yourself based on upstream branches
(git checkout -b mine origin/testing).

You can see these links in .git/config where they are maintained by git.

So, "git pull" depends on your current branch.  If that branch is linked
to an upstream one, that's what you'll be getting.  It may not always
be master, and it may not always be the "origin" remote.  (You can create
multiple remote upstream sources with git-remote)

Note that "git pull origin master" is a shortcut for doing
"git fetch origin ; git merge origin/master"


> 2. Does GIT have something like $ svn info . Taking example of another
> FOSS game project I like :-
> 
> $ svn info
> Path: .
> URL: https://dawn-rpg.svn.sourceforge.net/svnroot/dawn-rpg/trunk
> Repository Root: https://dawn-rpg.svn.sourceforge.net/svnroot/dawn-rpg
> Repository UUID: b4d8fe5f-8a90-43c9-9084-dcb629e63849
> Revision: 697
> Node Kind: directory
> Schedule: normal
> Last Changed Author: arnestig
> Last Changed Rev: 697
> Last Changed Date: 2010-12-14 03:52:13 +0530 (Tue, 14 Dec 2010)
> 
> If something like this is available in GIT please lemme know. I did
> try to read few of the Git cheat sheets but none of them talk of this
> thing. I'm sure its there somewhere I just don't know it. These are
> the things I tried.

This would be your origin.  You can view a list of your remotes with
"git remote" and display the details of each one with
"git remote show origin".  Replace origin with the remote name of choice.

Use "git remote show -n origin" if you are not connected to the internet
at the moment.


> a. :/usr/local/src/adonthell$ git pull origin master
> >From git://github.com/ksterker/adonthell
>  * branch            master     -> FETCH_HEAD
> Already up-to-date.

This just updates your repo and current branch.


> b. /usr/local/src/adonthell$ git show master
> commit 83ed46469f327a78d3dc839019797ebf56fee470
> Author: Kai Sterker <address@hidden(none)>
> Date:   Sun Dec 12 13:28:32 2010 +0100
> 
>     ADDED scrollbar/indicator widget
>     ADDED image/canvas widget
>     REMOVED caching of decoration
>     SPLIT decoration into border and background that can be rendered separatel

This shows various objects in the git repo.  Not remotes, that I know of.


> I had played around with git some years ago, memory got refreshed that
> git has some long gibberish number that humans can't understand. I am
> talking about commit 83ed46469f327a78d3dc839019797ebf56fee470

Every file, every directory, and every commit is a bunch of data
that has a SHA1 sum.  You can extract files, directory listings, and
commits and branches via these numbers.  Branch names and tags are
just convenience names to access these numbers.

Due to this factor, duplication can be removed from the system internally,
since the same file will be stored as the same git repo object using
the same SHA1 sum.


> I do remember reading somewhere that git has full working history so
> probably/possibly I could find or see how how changes had been
> happening (as in time between two commits and usually when and stuff
> like that). Is there some sane way to read stuff or the only way is to
> use this and use the hint of date and time to know what happened ?

Are you looking for git log?

Or maybe: gitk --all ?


> 3. Let's say there is some cmd and I do get the info (something
> similar to above) and I put these details in the same directory as the
> game directory just for example say a file which has "Sun Dec 12
> 13:28:32 2010 +0100" indicating the last time when the commit had
> changed and some other details. This is just for the self (to keep
> note/history of when I'm downloading stuff etc.) Whenever I do an 'git
> pull' or 'git pull origin master' it won't disturb the file and it
> won't disturb the directory structure which we are clong, right ?
> Please note that the file is nothing but notes for self.

As long as this notes file has not been added to the git repo with
git add / git commit, then git won't bother it.  But don't do something
like "git clean -xdf" which will erase everything that's not part of
the official git tree.

Hope this helps,
- Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]