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
OnceIWasAnOstrich
Jul 22, 2006

Boris Galerkin posted:

What is a good free git host that offers private repositories? I just need one repo for one user (me) to host my thesis. I don't want to pay for private repos on github and I don't want to do it myself with my EC2 server because I'd rather just have someone else do the backing up and other admin stuff.

I've been using Assembla's free private git repo for a project that I want private until it is released and its worked great.

Adbot
ADBOT LOVES YOU

wwb
Aug 17, 2004

Doc Hawkins posted:

If you just want backups, can't you use dropbox?

Because, I, at least would rather have a real SCM repo in the sky that I could use like that -- such as sharing the repo with others, using their visualization tools and other hoo ha.

That and I don't trust dropbox at all.

Magicmat
Aug 14, 2000

I've got the worst fucking attorneys

Boris Galerkin posted:

What is a good free git host that offers private repositories? I just need one repo for one user (me) to host my thesis. I don't want to pay for private repos on github and I don't want to do it myself with my EC2 server because I'd rather just have someone else do the backing up and other admin stuff.
GitHub gives away free "micro" level accounts for students. The plan includes 5 private repositories. Go here and shoot them a message and they'll set you up. They're really friendly.

Having tried other scm hosting solutions, Github is by far the best. Well worth the minimal hassle of shooting them a message. The team I'm on is currently using BitBucket for a large, funded CS project and, to be honest, I find it lacking. Not bad, but it's just not as nice to use and featureful as GitHub.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

Doc Hawkins posted:

If you just want backups, can't you use dropbox?

The main reason is because I need/want a VCS, the second because Dropbox has really lovely security. I do use Dropbox and it's great for backing up things that aren't particularly sensitive, like my pictures and class lectures, but I wouldn't store anything personal or private in that system.


Magicmat posted:

GitHub gives away free "micro" level accounts for students. The plan includes 5 private repositories. Go here and shoot them a message and they'll set you up. They're really friendly.

Wow, this is cool, since I already use github for personal use. Is a micro plan just a regular free plan with 5 private repos? Just sent the form.

brae
Feb 2, 2006

Boris Galerkin posted:

Wow, this is cool, since I already use github for personal use. Is a micro plan just a regular free plan with 5 private repos? Just sent the form.

Pretty much. It is the micro tier from the paid plans (https://github.com/plans) but you get it for free if you're using it for educational purposes.

crazyfish
Sep 19, 2002

Is there a way to determine certain properties about a remote git repository without cloning it? The reason I need to do this is that I have a lot of repositories (well over 100) on which I want to check if HEAD of branch x is tagged within that repo.

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

crazyfish posted:

Is there a way to determine certain properties about a remote git repository without cloning it? The reason I need to do this is that I have a lot of repositories (well over 100) on which I want to check if HEAD of branch x is tagged within that repo.

Are they on github? If so, the github API should be useful.

ToxicFrog
Apr 26, 2008


crazyfish posted:

Is there a way to determine certain properties about a remote git repository without cloning it? The reason I need to do this is that I have a lot of repositories (well over 100) on which I want to check if HEAD of branch x is tagged within that repo.

git ls-remote --heads <url> <branch> will give you the sha1 of <branch>; you can then use git ls-remote --tags <url> to list all of the tags and see if any of them match the branch head. I don't know if there's a way to do this in a single command, though.

If you know what the tag name should be as well the branch name, you can use filter patterns to just see if that tag exists; check the man page for details.

crazyfish
Sep 19, 2002

ToxicFrog posted:

git ls-remote --heads <url> <branch> will give you the sha1 of <branch>; you can then use git ls-remote --tags <url> to list all of the tags and see if any of them match the branch head. I don't know if there's a way to do this in a single command, though.

If you know what the tag name should be as well the branch name, you can use filter patterns to just see if that tag exists; check the man page for details.

Thanks a lot, this did the trick.

ufarn
May 30, 2009
GitHub have launched a great interactive online tool to learn git: https://github.com/blog/1183-try-git-in-your-browser.

This is probably the best way to learn people could have wished for.

Dealing with unexpected errors, however, are probably 90% of really learning git.

ufarn fucked around with this message at 23:12 on Jul 4, 2012

Thermopyle
Jul 1, 2003

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

ufarn posted:

GitHub have launched a great interactive online tool to learn git: https://github.com/blog/1183-try-git-in-your-browser.

This is probably the best best way to learn people could have wished for.

Dealing with unexpected errors, however, are probably 90% of really learning git.

I just ran through it real quick. Pretty nice!

lunar detritus
May 6, 2009


I having some problems conceptualizing the version control workflow (Git) as I have used FTP all my life.

If I'm using Dropbox for backup and revisions, should I use Git anyway?

I'm thinking of moving my local development to a virtual machine running linux to make it easier to test things before uploading to the real server. Would Git work better for that?

Suspicious Dish
Sep 24, 2011

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

gmq posted:

If I'm using Dropbox for backup and revisions, should I use Git anyway?

Do not use Dropbox for backup and revisions. It is not a professional version control tool. It is a backup service with a very light version control feature-set, with no promises (they can and will delete old versions of your work after some set of time).

gmq posted:

I'm thinking of moving my local development to a virtual machine running linux to make it easier to test things before uploading to the real server. Would Git work better for that?

For what?

Thermopyle
Jul 1, 2003

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

gmq posted:

I having some problems conceptualizing the version control workflow (Git) as I have used FTP all my life.

If I'm using Dropbox for backup and revisions, should I use Git anyway?

I'm thinking of moving my local development to a virtual machine running linux to make it easier to test things before uploading to the real server. Would Git work better for that?

Dropbox isn't source version control.

Check out the tutorial two posts prior to yours and then see if you have any more specific questions.

Unrelated: Every once in awhile I come across a webpage covering their favorite git workflows. Could some of you post your favorites?

Thermopyle fucked around with this message at 20:11 on Jul 7, 2012

ufarn
May 30, 2009
In fact, you can put your git repo inside your Dropbox folder. It works horrendously across Windows/Ubuntu some of the time, but it still works quite well for me.

I'm the kind of person who commits rarely - probably because I'm too much of a scrub to get it working in the first go.

Cat Plus Plus
Apr 8, 2011

:frogc00l:

ufarn posted:

In fact, you can put your git repo inside your Dropbox folder.

I wouldn't develop from inside Dropbox folder, but rather push to it like you would to remote (if you really want to use Dropbox — bitbucket/GitHub/own server will generally be better).

ufarn posted:

I'm the kind of person who commits rarely - probably because I'm too much of a scrub to get it working in the first go.

Committing often is a good habit to develop, even if the code doesn't work at the moment. VCS is there to record changes, after all. You can always edit history before pushing, if broken commits in the log bother you.

Thermopyle posted:

Unrelated: Every once in awhile I come across a webpage covering their favorite git workflows. Could some of you post your favorites?

One master repo and one fork per developer, with changes pushed to master via pull requests (allows for reviews and keeps history of who pushed what and when). It's simple and effective, makes "master repo should always be in working condition" rule easy to implement, and I can plug every fork into Buildbot. Yay for distributed model.

For branching I use stable & default (+ possibly feature branches), but I don't know how well would that work in git.

ufarn
May 30, 2009

PiotrLegnica posted:

Committing often is a good habit to develop, even if the code doesn't work at the moment. VCS is there to record changes, after all. You can always edit history before pushing, if broken commits in the log bother you.
Often, yes. If you are in college, committing often is great as evidence against plagiarism allegations.

I'm currently using it for a project that might also go on my resumé, so I'm trying to present a slightly doctored impression of my skills. :v:

But generally, it's definitely the way to go.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Thermopyle posted:

Unrelated: Every once in awhile I come across a webpage covering their favorite git workflows. Could some of you post your favorites?

Github Flow

Comrade Gritty
Sep 19, 2011

This Machine Kills Fascists

Github flow is excellent. I use it for anything that doesn't have actual releases. (Websites being the biggest one.)

Another good one that has been mentioned before is Git Flow. I use it for things that have releases with release numbers.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

gmq posted:

I having some problems conceptualizing the version control workflow (Git) as I have used FTP all my life.

If I'm using Dropbox for backup and revisions, should I use Git anyway?

I'm thinking of moving my local development to a virtual machine running linux to make it easier to test things before uploading to the real server. Would Git work better for that?

Another thing not mentioned is that Atlassian BitBucket offers unlimited free private repos if you keep below 5 users. Good way to get used to using git for your private work without setting up your own repo server.

Personally once I moved on from Drupal and PHP I'm very glad I also moved on from FTP to using git to pull the latest version to the deployment server. It's lighter on the bandwidth, and much less prone to manual error if you put together some deployment scripts to automate what you need to.

musclecoder
Oct 23, 2006

I'm all about meeting girls. I'm all about meeting guys.

Maluco Marinero posted:

Another thing not mentioned is that Atlassian BitBucket offers unlimited free private repos if you keep below 5 users. Good way to get used to using git for your private work without setting up your own repo server.

Personally once I moved on from Drupal and PHP I'm very glad I also moved on from FTP to using git to pull the latest version to the deployment server. It's lighter on the bandwidth, and much less prone to manual error if you put together some deployment scripts to automate what you need to.

Next step: use Capistrano for deployments. Good on you for moving in the right direction.

Dromio
Oct 16, 2002
Sleeper
My team is asking why some code is not where it's expected, and I'm confused by git for the first time in a very long time. Maybe someone here can tell me what's wrong.

I've got a branch with quite a few merges going on. Here's the history of the file in question:

pre:
*   95c2e96 Merge in stubGPGCC    (CODE IS GONE!)
|\  
| * 46dde8e remove URLME from Eprise 1 veps  (CODE WAS ADDED HERE)
* |   4e3c9d2 merged into prod                         (CODE DOES NOT EXIST HERE)
|\ \  
| |/  
| * 161e11a added signature and metadata for msgs and body
The code was added in 46dde8 but are NOT in the 95c2e96. The diff does not show it being removed in 05c2e96. Why did this happen?

Dromio fucked around with this message at 14:33 on Jul 9, 2012

ToxicFrog
Apr 26, 2008


Dromio posted:

The code was added in 46dde8 but are NOT in the 95c2e96. The diff does not show it being removed in 05c2e96. Why did this happen?

Diff 95c2e96 specifically against 46dde8 and see what it looks like.

At a guess, the merge used all the changes from 4e3c9d2 and dropped the ones from 46dde8e.

Dromio
Oct 16, 2002
Sleeper

ToxicFrog posted:

Diff 95c2e96 specifically against 46dde8 and see what it looks like.

At a guess, the merge used all the changes from 4e3c9d2 and dropped the ones from 46dde8e.

Yeah, git diff 46dde8 Path\To\TheFileInQuestion does show the changes. But gitk Path\To\TheFileInQuestion does not. Why wouldn't gitk show this?

So that merge was bad... and *I* was the one who did it. How did I mess this up? I'm pretty sure I didn't do something like "select all from theirs". Maybe I was just tired that day.

ToxicFrog
Apr 26, 2008


Dromio posted:

Yeah, git diff 46dde8 Path\To\TheFileInQuestion does show the changes. But gitk Path\To\TheFileInQuestion does not. Why wouldn't gitk show this?

I'm not sure what the underlying reason is, but in my experience "combined diffs" for merge commits are kind of unintuitive both in gitk and in git diff; furthermore, gitk often has trouble following branching/merging of a single file.

quote:

So that merge was bad... and *I* was the one who did it. How did I mess this up? I'm pretty sure I didn't do something like "select all from theirs". Maybe I was just tired that day.

git merge -s theirs would do this, as would accidentally hitting "use all from theirs" in mergetool. It's also possibly that it auto-merged and got it badly wrong, which is (a) a good reason to use --no-commit when merging and (b) probably worth a bug report if you can reproduce it.

Dromio
Oct 16, 2002
Sleeper

ToxicFrog posted:

git merge -s theirs would do this, as would accidentally hitting "use all from theirs" in mergetool. It's also possibly that it auto-merged and got it badly wrong, which is (a) a good reason to use --no-commit when merging and (b) probably worth a bug report if you can reproduce it.

I'm absolutely sure I didn't git merge -s theirs. It's kind of possible that I might have accidentally hit "use all from theirs" in a mergetool.

I'll keep the --no-commit flag in mind as I go forward, and see about reproducing it. For now, I get to untangle my mess and try to fix the code.

Thanks.

Vanadium
Jan 8, 2005

Why the hell does git push someremote somebranch cause origin/somebranch to get updated when origin isn't someremote?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
It doesn't for me. Just tested.

Deus Rex
Mar 5, 2005

Vanadium posted:

Why the hell does git push someremote somebranch cause origin/somebranch to get updated when origin isn't someremote?

Is somebranch tracking origin/somebranch?

lunar detritus
May 6, 2009


Thermopyle posted:

Dropbox isn't source version control.

Check out the tutorial two posts prior to yours and then see if you have any more specific questions.

I tried it! I think I understand the how it works but, for example, if I'm deploying things to a production web server, is this what I'm supposed to do?

Local Repository (multiple ones depending on where I'm working)
Remote Depository (GitHub or on my own server)
Remote Depository (Production Web Server)

So, I would edit locally, commit and push to Git Server and once it's ready push to Web Server (or pull from Web Server?)?

Vanadium
Jan 8, 2005

Deus Rex posted:

Is somebranch tracking origin/somebranch?

Yeah

Cat Plus Plus
Apr 8, 2011

:frogc00l:

gmq posted:

So, I would edit locally, commit and push to Git Server and once it's ready push to Web Server (or pull from Web Server?)?

Yes, you push to production if you're ready to deploy (you could SSH there and pull from other remote, but that's more work). You can use post-push hook to automate deployment tasks like restarting the app, so you don't have to SSH and do it manually afterwards (for more complex procedures, you might want to look into dedicated deployment tools). Pulling from production should be unnecessary, unless you do dirty fixes straight there.

Bit off-topic: if you want to use a VM for staging, check out Vagrant.

Cat Plus Plus fucked around with this message at 21:52 on Jul 12, 2012

lunar detritus
May 6, 2009


PiotrLegnica posted:

Yes, you push to production if you're ready to deploy (you could SSH there and pull from other remote, but that's more work). You can use post-push hook to automate deployment tasks like restarting the app, so you don't have to SSH and do it manually afterwards (for more complex procedures, you might want to look into dedicated deployment tools). Pulling from production should be unnecessary, unless you do dirty fixes straight there.

Bit off-topic: if you want to use a VM for staging, check out Vagrant.

Thanks! This is really breaking my brain for some reason.

ufarn
May 30, 2009
How do I bring the new ahead changes from my master branch to another branch? I assume it's some kind of fetch command?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
What VCS are you using?

ufarn
May 30, 2009

Suspicious Dish posted:

What VCS are you using?
git on GitHub.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
So you have two branches, and you want to merge them together? You can do that with a merge or a rebase.

ufarn
May 30, 2009

Suspicious Dish posted:

So you have two branches, and you want to merge them together? You can do that with a merge or a rebase.
Not a merge. I just want to get the recent commit from my master branch to my dev branch.

Deus Rex
Mar 5, 2005

ufarn posted:

Not a merge. I just want to get the recent commit from my master branch to my dev branch.

Check out git cherry-pick. The cherry-picked commit won't be the same commit as the original (note the different SHA), but the changes should be the same (subject to any merge conflicts you might come across).

http://technosophos.com/content/git-cherry-picking-move-small-code-patches-across-branches

Adbot
ADBOT LOVES YOU

Jam2
Jan 15, 2008

With Energy For Mayhem
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?

Only registered members can see post attachments!

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