some git usage related queries
Peter Avalos
pavalos at theshell.com
Sun Nov 8 01:57:33 PST 2009
On Sun, Nov 08, 2009 at 02:12:24PM +0530, Saifi Khan wrote:
> Hi:
>
> Here are some git usage related newbie queries.
>
> 1. i read a notification about a new commit
> eg. pkgsrc commit
> http://gitweb.dragonflybsd.org/pkgsrc.git/commit/4ceab3c0055ed6bdacff399294ff8ef253b99468
>
> Since i maintain a local git repo for pkgsrc, i'd like to
> know the diff between what i got and what's in the latest
> commit.
>
> What command do i run locally to see the diff ?
>
git diff 4ceab3c0055ed6bdacff399294ff8ef253b99468
This only works if you've updated your remotes though (git fetch or git
remote update)
>
> 2. i've pulled in latest commits using 'git pull'.
> While working with local repository, i want to
> know the diff between the last commit and the latest commit
> for a given file eg. nrelease/Makefile.
>
> what i tried doing was:
> # cd /usr/src
> # cd nrelease
> # git diff HEAD^ HEAD ./Makefile
> #
>
> This doesn't work. What is the correct approach here ?
>
I'm not exactly sure what you're trying to do, but I guess you're going
for:
git log -p Makefile
>
> 3. after pulling in the changes related to Sascha's commit eg.
>
> when i tried this command:
> # git describe 5623ae32853fcfb747f493ea6af0059a56fb9b56
> v2.5.1-200-g5623ae3
>
> This doesn't show up the details of the commit. What would be
> the appropriate command to use ?
>
>
git show 5623ae32853fcfb747f493ea6af0059a56fb9b56
> 4. i apply some patches to a given file
> eg. Stathis' patch for mq*() syscall for MPSAFE
>
> # cd /usr/src
> # fetch http://leaf.dragonflybsd.org/~beket/mq-mpsafe.diff
> # git apply mq-mpsafe.diff
>
> Ideally i should have created a branch and then apply the
> patch. However, i applied the patch to the master.
> Some new files are created and some .bak files created.
> When i 'git pull' next, there are issues.
>
> What is a good practice to adopt here ?
>
Lots of options for this...I would create a new branch, commit the
change, then use git rebase to bring in any new changes.
> Is there also something as 'unapply' a patch in git ?
>
git reset
>
> i've readup Pragmatic version control with Git and GitUsage
> documentation in the wiki. So, while i can get around with basic
> Git commands, i'm still facing issues.
>
> i'd be grateful, if some of experienced folks on the project can
> share their nuggets of wisdom on this. Thanks for any help.
>
Try the manual pages or git help too.
--Peter
Attachment:
pgp00003.pgp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00003.pgp
Type: application/octet-stream
Size: 198 bytes
Desc: "Description: PGP signature"
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20091108/a0986a0d/attachment-0021.obj>
More information about the Users
mailing list