Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Modern Pragmatist
Aug 20, 2008

Jam2 posted:

I updated to Mountain Lion and Sublime text has lost track of git. I had to reinstall git after updating my OS. How do I fix this issue?



Chances are git is located at /usr/local/bin/git. You can check by typing "which git" in terminal.

Then you just need to add it to your path in ~/.bashrc
code:
export PATH=/usr/local/bin:$PATH

Adbot
ADBOT LOVES YOU

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

Modern Pragmatist posted:

Chances are git is located at /usr/local/bin/git. You can check by typing "which git" in terminal.

Which looks in your PATH, so if that program can't find it, which won't either, unless the program has its own PATH.

Modern Pragmatist
Aug 20, 2008

Edison was a dick posted:

Which looks in your PATH, so if that program can't find it, which won't either, unless the program has its own PATH.

Oh right. Duh. Should be in /usr/local/bin though.

Jam2
Jan 15, 2008

With Energy For Mayhem

Modern Pragmatist posted:

Chances are git is located at /usr/local/bin/git. You can check by typing "which git" in terminal.

Then you just need to add it to your path in ~/.bashrc
code:
export PATH=/usr/local/bin:$PATH

Is it odd that which git returns /usr/local/git/bin/git?

Jam2
Jan 15, 2008

With Energy For Mayhem
Adding the line

export PATH=/usr/local/git/bin:$PATH

does not work. Is this incorrect?

I want to have a better understanding of "PATH" and how to manipulate it. What exactly is the PATH?

Magicmat
Aug 14, 2000

I've got the worst fucking attorneys
Apps not launched from bash don't inherit its environmental variables. Follow the dialog's instruction and set the user variable.

Jam2
Jan 15, 2008

With Energy For Mayhem

Magicmat posted:

Apps not launched from bash don't inherit its environmental variables. Follow the dialog's instruction and set the user variable.

I don't understand what the prompt is instructing me to do. What is the user variable?

Modern Pragmatist
Aug 20, 2008

Jam2 posted:

I don't understand what the prompt is instructing me to do. What is the user variable?

Check out the "Settings" section here:

https://github.com/kemayo/sublime-text-2-git/wiki

ToxicFrog
Apr 26, 2008


Jam2 posted:

I want to have a better understanding of "PATH" and how to manipulate it. What exactly is the PATH?

$PATH is an environment variable (essentially, a user setting accessible to all programs that you start - although it can have different values for different programs depending on how you start them!) listing all of the directories that it should search for programs, separated by :.

For example, my $PATH at home is /home/ben/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games - meaning that if I enter 'git', it will look first* for /home/ben/bin/git, then /usr/local/sbin/git, then /usr/local/bin/git, and so on. If it can't find git in any of those directories, it errors.

The "different values for different programs" bit is important; it's quite possible for (e.g.) the terminal and Sublime Text to have different values for $PATH depending on your configuration, meaning that one can find git and the other can't. In particular, it's not uncommon to have:

- system-wide $PATH entries, which everyone gets
- user-specific $PATH entries, which all programs you run see
- shell-specific $PATH entries, which apply only to stuff you start through bash (or ksh, or tcsh, or whatever shell you use)

And then, on top of that, if you change $PATH in the shell it'll affect that shell (and programs launched from it) only, not anything else you're running then or in the future.

This is actually very useful at times, since it means you can launch programs with different environment variables to customize their behaviour - but it can be confusing starting out, especially if you - say - don't realize this, open a shell, change $PATH there, and then wonder why your editor isn't seeing those changes. :)

* Ok, strictly speaking it checks aliases, functions and builtins first; the $PATH search happens when it realizes it has no built-in way of handling that command and needs to run a separate program.

Mniot
May 22, 2003
Not the one you know
My office uses SVN and it's almost always everything we need. However, every so often I try to make a big code branch that develops independently of trunk for a week or so, and when I try to merge it back to trunk SVN fucks everything up and I have to do it all by hand. I see things like:

old code:
code:
// bla bla bla
public int foo() {
   return 0;
}
// blurg blurg blurg
my version of this file:
code:
// bla bla bla
public int foo() {
  if (x)
    return 5;
  else
    return 0;
}
// blurg blurg blurg
SVN's helpful contribution:
code:
<<<mine
public int foo() {
  if (x)
    return 5;
  else
    return 0;
}
// blurg blurg blurg
====
// bla bla bla
public int foo() {
   return 0;
}
// blurg blurg blurg
>>>revision whatever
Sometimes it's even worse, interleaving new and old code in ways that don't make sense. It seems to happen every time my branch is non-trivial.

I've played briefly with Git and it seems to do this much less. Is it actually the case that new DVCSs are better at merging, or am I just fantasizing? And is my SVN problem legitimate, or am I just doing it wrong?

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Mniot posted:

I've played briefly with Git and it seems to do this much less. Is it actually the case that new DVCSs are better at merging, or am I just fantasizing? And is my SVN problem legitimate, or am I just doing it wrong?

Maybe I was doing it wrong too, but it happened enough times that I just said gently caress it and moved all of our development to Mercurial. It's a lot smarter about merging in the sense that it won't ruin my loving files, but the merge tools aren't that great and still want to produce crap instead of things that make sense.

Zhentar
Sep 28, 2003

Brilliant Master Genius
The newer VCSs are better at merging in some situations, but SVN isn't that bad. You're loving something up. From your example, it looks like you've had a merge conflict elsewhere in the file, and what you've shown is a non-conflicting merge section that's just in an intermediate state waiting for you to use a merge tool to resolve the conflict.

I will recommend KDiff3 as a merge tool.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Mniot posted:

SVN's helpful contribution:
If the text in the comments has changed, then that is a normal merge conflict. Individual lines that have not changed, but are sandwiched between lines that have, are included in the conflict so that you have fewer conflicts to resolve.

A common reason for merging to fail (but in every VCS) is that your editor hosed with the tabs/spaces used for indentation. You should have a coding standard for that and your editor should be set up to follow it.

Gazpacho fucked around with this message at 22:12 on Jul 16, 2012

ufarn
May 30, 2009
The git shell has started asking me for my username and password instead of my ssh password. Why is this? I tried to erase the .git folder and start over, but that didn't help. It's just this folder/project that doesn't seem to work for some reason.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Maybe because you checked out with the new fancy smart HTTPS instead of ssh?

ufarn
May 30, 2009

Suspicious Dish posted:

Maybe because you checked out with the new fancy smart HTTPS instead of ssh?
Ahh, that's probably it. Thanks. I wonder why the hell the GitHub guide used https. I don't recall that happening before.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I don't know why, but they're really pushing it. My guess is that they don't want to have people generate SSH keys on Windows.

Comrade Gritty
Sep 19, 2011

This Machine Kills Fascists

Suspicious Dish posted:

I don't know why, but they're really pushing it. My guess is that they don't want to have people generate SSH keys on Windows.

If you select "SSH" it'll default to you for that from now on.

indulgenthipster
Mar 16, 2004
Make that a pour over
I want to contribute to a project on GitHub so I forked their project, then cloned my fork. Aptana then wants to then commit all files added from the clone... is that normal behavior? Shouldn't it start from where the developer left off?

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
My coworker and I are switching to Git for our current project (I had been using it for my part for a while, he hasn't been using version control but wants to start). What's the easiest way for us to share a repo? We're on windows 7 and both of our workstations are on one intranet; I have a Debian VM on my workstation as well in case that turns out to be the easier route.

I'd like to avoid going through an external site (eg. Github) not so much due to cost but rather because there would hoops to get such a thing approved for 'security' reasons.

I'd also like to host it from my machine or my coworker's if possible, again not for any technical reason but rather because putting it on some third machine involves dealing with our outsourced IT and would take a month and they'd probably try to force us to use SourceSafe somehow.

wwb
Aug 17, 2004

If you aren't completely sold on git mercurial is a bit easier -- it comes with a built-in web server so all he has to do is fire that up to share stuff. Another option would be to setup a VM running one of those bitnami pre-rolled machines, they have a SCM provider that I think gives you git, hg, svn and bazar in one box.

Also note that bitbucket does HG and git and is free for private repos for under five users so you could probably use that without going through approval channels depending on if it was the expenditure that was needing approval.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

Otto Skorzeny posted:

I have a Debian VM on my workstation as well in case that turns out to be the easier route.

This will probably be the easiest route.

Short-term, you could use your Windows machines. You'd both create git-daemon-export-ok files in your repositories and run git daemon --base-path=/parent/dir/of/your/repository. You can then fetch from each other with URLs of the form git://your-coworkers-pc/repo-dir-name.

I would strongly recommend that you use a Linux machine, but once both of you start to depend on a repository host it can be a pain to use a VM on your desktop machine. You could conceivably create a new user in that VM, store a bare repository in that user's home directory and both of you can login as that user to push/pull from the bare repository (using SSH keys is preferred). That would be very easy to set up and I don't see any serious problems in using this for only two people.

The best solution would be to use Gitolite, though. This software manages access control to repositories, using usernames and SSH keys. You'd put your bare repository(ies) somewhere like /srv/git/repositories, install Gitolite into that location, and let Gitolite manage access control for you.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug
Team Foundation Server 2012 Express is out, in case anyone was interested in trying it out. I know TFS doesn't get a lot of love in this thread, but I figure it's worth mentioning. Express supports up to 5 developers.

uXs
May 3, 2005

Mark it zero!
Is VS2012 really out yet? Or is it only people with expensive MSDN subscriptions or whatever.

Cat Plus Plus
Apr 8, 2011

:frogc00l:

uXs posted:

Is VS2012 really out yet?

Yes, it was released about a week ago.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

uXs posted:

Is VS2012 really out yet? Or is it only people with expensive MSDN subscriptions or whatever.

Express editions are out. MSDN subscribers can get the full thing. Everyone else gets it in a few weeks.

ufarn
May 30, 2009
Does someone know Github's shorthand syntax for tables in Markdown? It's something like `::foo: bar" for a single row of two cells, but I can't for the life of me remember how it's done. And the documentation on it is non-existent.

Pardot
Jul 25, 2001




ufarn posted:

Does someone know Github's shorthand syntax for tables in Markdown? It's something like `::foo: bar" for a single row of two cells, but I can't for the life of me remember how it's done. And the documentation on it is non-existent.

I wrote a thing that takes a sql query and transforms it to markdown tables, so here is a a markdown table of everyone born today who has a wikipedia article https://embedclip.herokuapp.com/lipjdmagqurraxhaaqrvfoipccrt.md

Dromio
Oct 16, 2002
Sleeper
We've been using feature branches with git for some time and gotten pretty comfortable with them. However, there's one issue I don't have a good answer for. I often use "git branch -r --merged" on our current QA branch to see what features have been put into the latest build, but this only works until a developer updates a feature branch without telling me. Since the --merged option only shows branches FULLY merged into the current branch, I'll end up not seeing that feature/AddedReallyCoolStuff is partially in QA but isn't fully up to date.

Any ideas on how to handle this sort of situation without keeping some sort of list myself outside of git? I'm not so good at that sort of thing.

Argue
Sep 29, 2005

I represent the Philippines
I'm doing a git svn clone of a repo, and am trying to clone far back enough to see the branching history. The problem is that now it keeps timing out while fetching a particular revision--it's having trouble because some genius checked in branches/dev/projectName/src/main/menugen/Desktop/Docs/Ray's Music/*.mp3, among a lot of other things. What do I do? Is there a way to make git-svn ignore that folder before I've cloned it?

As far as I can tell, an interrupted svn checkout can be resumed by just calling svn update, but calling git svn fetch on an interrupted clone resumes by starting over from the most recently fetched revision. At least, that's what I think is happening here. If I can't ignore that folder, is there a way to at least make it resume the checkout properly?

Mr. Crow
May 22, 2008

Snap City mayor for life
I'm only familiar with TFS (from work), going to start working with a friend on an android app in my spare time and I want to get familiar with the other kinds of Source Control.

Any recommendations for one to use?

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug

Mr. Crow posted:

I'm only familiar with TFS (from work), going to start working with a friend on an android app in my spare time and I want to get familiar with the other kinds of Source Control.

Any recommendations for one to use?

Git with https://github.com or https://bitbucket.org or Mercurial with bitbucket.org would probably be the two main suggestions. I found Mercurial easier to use but git is the new hotness and the source control all the cool kids are using.

Cat Plus Plus
Apr 8, 2011

:frogc00l:

Mr. Crow posted:

Any recommendations for one to use?

Mercurial or Git. On Windows Mercurial has TortoiseHg, which is simply awesome, but overall they mostly differ in philosophy and underlying model is pretty much the same.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I use git via the command line pretty much exclusively on Windows, but after a reformat this past weekend I installed Git Extensions to try it out. Works really nice!

Not having used TortoiseHg, I don't know how they compare, but anyway, there you go...

Mr. Crow
May 22, 2008

Snap City mayor for life
Seems like Mercurial is free for private repositories, while Git is not? Probably end up trying Mercurial in that case, thanks :)

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug

Mr. Crow posted:

Seems like Mercurial is free for private repositories, while Git is not? Probably end up trying Mercurial in that case, thanks :)

Bitbucket allows you to use git or Mercurial and free private repositories. Also, there is GitHub for Windows which you can use for bitbucket but you have to start the repository from the command line and connect it to Bitbucket.

gariig fucked around with this message at 19:43 on Sep 20, 2012

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

Mr. Crow posted:

Seems like Mercurial is free for private repositories, while Git is not? Probably end up trying Mercurial in that case, thanks :)

GitHub is not Git, and Bitbucket is not Mercurial.

Golbez
Oct 9, 2002

1 2 3!
If you want to take a shot at me get in line, line
1 2 3!
Baby, I've had all my shots and I'm fine
Not sure which command(s) to do for this, which seems simple, but being a relative git neophyte I'm not sure:

We have a branch. I've since made two commits to it, mainly to store coding ideas, but they didn't pan out, so I want to revert it to where it was two commits ago. I don't want to nuke the more recent commits; I just want to do...

Commit A: Good stuff
Commit B: Bad stuff
Commit C: Worse stuff
Commit D: I want this to have the same state as commit A

How do I do this? I decided to throw hard and hit "git reset --hard" and that appears to have nuked commits B and C from history - there is no commit D, there is simply A. No real harm done, but I had wanted to keep them around as warnings to others. What would have been the proper way of doing this? Checking out A and committing it?

Cat Plus Plus
Apr 8, 2011

:frogc00l:

Golbez posted:

How do I do this? I decided to throw hard and hit "git reset --hard" and that appears to have nuked commits B and C from history - there is no commit D, there is simply A. No real harm done, but I had wanted to keep them around as warnings to others. What would have been the proper way of doing this? Checking out A and committing it?

You don't need commit D, whether you want to nuke B and C or not. You can branch off history at any point, just checkout A and keep working as if it was the newest revision. You can also tag C for easier access later.

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Mr. Crow posted:

Seems like Mercurial is free for private repositories, while Git is not? Probably end up trying Mercurial in that case, thanks :)

That's only GitHub. You can still deploy git or a git-based solution on your internal network, that's entirely private, with no cost.

When learning Git, I'd highly recommend GitHub, as it makes a lot of things easy that you really shouldn't have to deal with out of the box.

http://try.github.com/

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply