logo
IRC Archive / Freenode / #git / 2009 / December / 29 / 5
crab
you can do it pretty easily in p4
fynn
Hey. I vaguely recall there's a way to ignore working-copy subdirectories in a local way.
I.e. it would work on my working copy, but won't be propagated to any clones.
(so it's not by adding a .gitignore)
crab
.git/info/exclude
takes the same kind of pattern(s) as .gitignore
fynn
crab: thanks, that was it. where is it in the mans/docs, btw?
tekky
sitaram: heya :)
sitaram
hi!
tekky: ^
tekky
you have a good weekend? (showing my ignorance -- but dont know if you celebrate this time of year :P)
sitaram
tekky: absolutely great, but nothing to do with religion (25th anniv reunion of my college class -- yeah I'm ld ;-)
old*
tekky
lol congrats
sitaram
and nothing to do with the new year... not yet anyway :)
tekky
I just got my inet hooked up :P
fynn
was there any change in 1.6.6 wrt how work trees are handled?
tekky
16M down, 4-8M up :)
sitaram
(Action) is jealous... he can get 10% of that (assuming bps not Bps) on a really good day
tekky
sitaram: Download Speed: 16433 kbps (2054.1 KB/sec transfer rate) ---- Upload Speed: 5484 kbps (685.5 KB/sec transfer rate)
less confusion
fynn
I'm using the following command: GIT_WORK_TREE=$HOME/rawdata GIT_DIR=$HOME/rawdata/.git git reset --hard
with earlier versions, it worked fine
with 1.6.6, I get: "fatal: hard reset requires a work tree"
which only succeeds if I run the command from within $HOME/rawdata
sitaram
fynn: try not using both GIT_WORK_TREE *and* GIT_DIR maybe? (I've never used both; the current directory was always one of them)
fynn
sitaram: $ GIT_WORK_TREE=$HOME/rawdata git reset --hard
fatal: Not a git repository (or any of the parent directories): .git
again, the same command works when I'm in ~/rawdata
it also occurs when I use the --work-tree argument :/
this could be a bug.
sitaram
fynn: gitolite easy install *depends* on "cd to bare repo; GIT_WORK_TREE=somewhere-else git subcommand" and I just tested with 1.6.6
fynn: and it works fine
(haven't tried reset --hard; my commands are add, diff, commit)
fynn
well, it doesn't work here.
OK, this is most definitely a version-related problem:
$ GIT_WORK_TREE=$HOME/rawdata/ GIT_DIR=$HOME/rawdata/.git /usr/local/git-1.6.6/bin/git reset --hard
fatal: hard reset requires a work tree
$ GIT_WORK_TREE=$HOME/rawdata/ GIT_DIR=$HOME/rawdata/.git /usr/local/git-1.6.4/bin/git reset --hard
HEAD is now at 77ec73f...
sitaram
fynn: my bare repos are not called ".../.git" and they *do* have a "core.bare = true". I'm not saying that 1.6.6 didn't change -- I'm trying to narrow it down so you know how to report it :)
fynn
sitaram: yeah, thanks. I'm probably going to report it.
sitaram
fynn: aha... reset --hard doesn't work!
add, diff, commit, do!
fynn
yay, I found a genuine bug
sitaram: should I just send an email to the mailing list?
sitaram
wait
testing with checkout -f also (which is the same thing in this special case)
yup; that works fine, but reset --hard doesn't.
in a way this makes sense... reset is about changing HEAD itself
fynn
sitaram: cool, sending that email.
sitaram
fynn: wait
fynn: well you can send it but I have a link that might shed some light on this
fynn: there's a fundamental difference in what a "reset" does versus what a "checkout" does; and I think -- even though the behaviour changed -- there would be an explanation for why. So ask away, and I'd be interested in the response too
fynn
sitaram: *nod*, sending.
sent.
sitaram: thanks for making the effort to confirm this.
sitaram
you're welcome!
(I mean it may not be a *bug* per se, maybe an intentional change...)
chuck
why doesn't git automatically setup tracking branches for all remote branches?
adamm
because many times I don't want it to do that
fynn
chuck: what if the remote has 1,000 branches, and 999 of them only interest the remote user?
under most distributed workflows, you're usually not automatically interested in a branch created on the remote; the opposite, in fact.
developish
i have a file that is tracked in my repo, but i want to ignore future changes to it, how do i do that?
sitaram
developish: the first para of "man git-ignore" will tell you
ArjenL
man gitignore (or 'git help ignore' :-)
Gitbot
ArjenL: the gitignore manpage can be found at http://git.or.cz/man/gitignore
ravionrails
i have made local server on my LAN and push my projects . i get only .git and nothing else there . why?
tomoj
ok, I am trying to understand the "you asked me to pull without telling me which branch you want to merge with, and 'branch.nullsfix.merge'..." error
is this something new because I upgraded? or did I somehow wind up in some situation I just hadn't ever been in before?
Ilari
ravionrails: $faq non-bare
Gitbot
ravionrails: Pushing to non-bare repositories is discouraged. See http://git.or.cz/gitwiki/GitFaq#non-bare
developish
now how do i access the "git update-index --assume-unchanged documentation."
Ilari
developish: 'man git-update-index'?
Gitbot
developish: the git-update-index manpage can be found at http://git.or.cz/man/git-update-index
tomoj
ooh, I see the problem
didn't realize I was on the 'nullsfix' branch
developish
great i didn't know how to use the manpages for all those commands
fynn
sitaram: still awake?
alrock
hi, I'm using git with cygwin and whenever I "git push" to the server, it changes the permissions of my files in the repository
sitaram
fynn: I'm at work, it's 2:46pm!
fynn
no it's not, it's 1:16am
alrock
it removes the execute/modify etc permissions which creates some problems with the app
sitaram
(and there's not a meeting in sight, so I can't really sleep! ;-)
I'm going to ask why that patch is necessary.
sitaram
bot, tell me 952dfc6
Gitbot
[git 952dfc6]: http://tinyurl.com/yf3okte -- reset: improve worktree safety valves
fynn
sitaram: commit is here: http://github.com/git/git/commit/952dfc6944b29582482ff50a85c04879406c06ba
sitaram
fynn: the correct question is "why does this not honor GIT_WORK_TREE", I think
Rhonda
When I created a new branch locally that I want to push to a remote, a "git push origin newbranch" is sufficient. But that doesn't add the tracking of the branch to .git/config. What am I missing, is there a simple option that I haven't found?
sitaram
and you might wanna mention that "git checkout -f" does work...
raboof
i'd like to work on the 'mob' branch of 'http://repo.or.cz/w/jack_mixer.git'.
so i should just clone ssh://repo.or.cz/srv/git/jack_mixer.git and then switch to the 'mob' branch, right?
fynn
sitaram: thanks, I'll go give them a piece of my mind!
bob2
raboof: clone, then make your own branch and work on that
alrock
anyone? :/
selckin
alrock: git is not a deployment tool
raboof
bob2: there's work in the 'mob' branch that's not in master yet and that i'd like to build on
bob2
raboof: branch from mob then :)
sitaram
fynn: erm no I didnt mean that (piece of my mind!)
fynn: as I said, there is a difference in intent between reset and checkout, and am wondering if that is the reason for this in some way that I do not yet understand completely
raboof
bob2: how? i tried 'git checkout mob', but that gets me 'error: pathspec 'mob' did not match any file(s) known to git'. 'git branch mob' works, but it looks like that makes a new local branch instead of switching to the existing mob branch.
fynn
sitaram: too late, I already posted the most inflammatory flame on the git list!
raboof
('git branch mob' and then 'git checkout mob', that is)
sitaram
fynn: :)
fynn
I insulted Junio, Linus, and sweet baby Jesus
selckin
raboof: git branch -a
bob2
raboof: git checkout -b mob origin/mob
sitaram
fynn: and two of tehm had birthdays recently, AFAIK :)
them*
fynn
two... or are they really one?!
bob2
though I think checkout has a magicer way to do that
fynn
sitaram: (more seriously, I think if you specify both GIT_WORK_TREE and GIT_DIR, the reset should work)
raboof
bob2: ha, looks like 'git checkout remotes/origin/mob' was what i was looking for - thanks
selckin: thanks ;)
bob2
raboof: that doesn't make a branch you can commit to
raboof: or does 'git branch -a' show that it did?
alrock
selckin: so what do you suggest I should do?
fynn
sitaram: (that patch was meant to prevent .git from getting accidentally mangled; if you specify both the above, and the repo is non-bare to boot, there's no way that I can see that this patch improves repo protection)
raboof
bob2: oh, right, i'm now at '(no branch)'
selckin
alrock: autotools seem popular for installing stuff
bob2
raboof: I think you want the command I suggested - it creates a new (local) branch based on 'mob' and checks it out
raboof
bob2: yeah, that looks better
sitaram
fynn: agreed...
fynn: it should just honor GIT_WORK_TREE really
alrock
selckin: I'm using it like http://toroid.org/ams/git-website-howto so that I can commit locally then push it to server to update the live site/code, it's just one server
selckin
alrock: bad advice is bad
alrock
how can I setup an alias for "ssh://name@server/" part?
I don't want to store the repo path in the alias
just the username@server
Ilari
alrock: insteadof lines (I don't remember the syntax outright)?
alrock
Ilari: what?
Ilari
alrock: Search man git-config for "insteadOf".
Gitbot
alrock: the git-config manpage can be found at http://git.or.cz/man/git-config
alrock
ah, that's it. thanks
GDG
how can I roll back to a previous file version with git? in svn I use svn up -r<rev>.
selckin
checkout
GDG
selckin, but checkout to which version?
selckin
the one you want
GDG
how can I get the version
sorry
selckin
git log?
bob2
GDG: you can tell it the version in lots of different ways
GDG
I tried git log
but I am never seeing a version id
(sorry I am a svn user)
nevyn
0f8d51b
is a recent version of a tree I'm tracking
you should see a bunch of stuff like that.
GDG
commit 581e06110a00669da1b54b82225fcac357d8f154
I see this
is this my version id?
selckin
yes
GDG
it is uge
or better it is an hash
selckin
it's a sha1
GDG
ok
selckin
there are other ways to specify versions
GDG
which are
bob2
you can use just a prefix
man git-rev-parse
GDG
I just need 1 step back
Gitbot
bob2: the git-rev-parse manpage can be found at http://git.or.cz/man/git-rev-parse
wereHamster
you can just use the first four or five characters of the hash
bob2
HEAD^
GDG
what is HEAD^ ?
bob2
the previous revision
ambuli
what the equal command for svn update ?? in git
nevyn
ambuli: git pull
ambuli: but git pull is syntactic sugar around a git fetch and git merge
ambuli: so you can do a 2 phase update if you want which will firstly fetch the upstream changes to the indexx
then let you examine the upstream changes and integrate them into your tree
ludde2
hi nevyn
ambuli
nevyn, what is the command i have use for both ??
ludde2
nevyn: do i know you? :p
nevyn
ambuli: git pull
ludde2
i guess not
ambuli
nevyn, so git pull does both phase is it ??
ludde2
you seem to be a different nevyn
nevyn
possibly
Ilari
The changes are not fetched into the index. They are downloaded to refs.
nevyn
ambuli: yes it does..
ludde2
you're not from sweden, are you
nevyn
Ilari: my bad. you're correct..
ludde2: no I'm not
I'm from australia
ambuli
nevyn, so git fetch is for phase 1 and git merge is for phase 2 if i understand correctly ??
nevyn
ambuli: yes
ambuli
nevyn, Ah.. cool. Thanks nevyn
nevyn
ambuli: and git pull does both.
but I only ever use git pull where I'm not doing work
so if I'm just using git as a tracking tool for an upstream library or something I'll git pull
ambuli: or if you work in a branch and keep master just to track upstream then that works too.
ambuli
neunon, ok
Juerd
I have two completely different repositories, one local, one remote. I want to add the local files to the remote repo. Is it possible to retain the changes history?
nevyn
they don't have a common root at all?
Juerd
No
ambuli
nevyn, what about --amend option ??