|
Right now I keep absolutely everything I do in its own feat/*, fix/*, test/*, or qa/* branch, then --no-ff merge it back into master when done to preserve detailed branch history. Eventually it's kicked out to a long running stable branch when it's ready to get a version stamped on it and released. I think it's mostly because I like seeing pretty lines when I do `git log --graph --oneline`.
|
# ? Oct 20, 2015 00:46 |
|
|
# ? May 13, 2024 09:42 |
What's your favorite mergetool on linux? I've been using kdiff3, wondering if there's anything else I should check out.
|
|
# ? Oct 20, 2015 23:35 |
|
fletcher posted:What's your favorite mergetool on linux? I've been using kdiff3, wondering if there's anything else I should check out. p4merge is amazingly good.
|
# ? Oct 21, 2015 01:44 |
|
wwb posted:SVN is a very, very different model from perhaps a different era. If you want it to behave like git it sucks, just ask linus. On the flip side when you want git to behave like SVN that can also suck. Go figure.
|
# ? Oct 21, 2015 01:51 |
|
The other thing one can do in SVN you can't quite do directly in git is check out parts of trees. We've got a few opsy things we run that way with SVN that would never work with git without a bit more doing. If your version control is simple enough that you've got an effectively linear commit system with minimal branching than just about any modernish CVS system will work.
|
# ? Oct 21, 2015 22:19 |
|
wwb posted:The other thing one can do in SVN you can't quite do directly in git is check out parts of trees. We've got a few opsy things we run that way with SVN that would never work with git without a bit more doing. Yeah, if you want to do sparse checkout, it's a per repository clone option, and you have to do it before checking out, so it's a PITA. http://phatblat.com/blog/2014/09/14/git-sparse-checkout/ seemed to be the best documentation I could find on getting it to work, since it wasn't very clear in the manpages from what I could find.
|
# ? Oct 21, 2015 23:10 |
|
Edison was a dick posted:Yeah, if you want to do sparse checkout, it's a per repository clone option, and you have to do it before checking out, so it's a PITA. When you check out part of a tree in SVN you don't get the entire repository, though. This method you still fetch *everything*, but the checkout will only be that sub-tree. Semantically it will look the same, but if the point is to save space or bandwidth this won't help.
|
# ? Oct 22, 2015 02:17 |
|
necrotic posted:When you check out part of a tree in SVN you don't get the entire repository, though. This method you still fetch *everything*, but the checkout will only be that sub-tree. Semantically it will look the same, but if the point is to save space or bandwidth this won't help.
|
# ? Oct 22, 2015 02:23 |
|
That's very very dependent on what you're storing and how much history you have.
|
# ? Oct 22, 2015 02:34 |
|
Has anyone used hgweb? I want to stick it (or something similar) on my web hosting to publish some of my coding projects as part of my resume/portfolio. There's probably enough documentation to get it working, but I'm still not sure what I'll actually be getting. Will there be a nice web interface to look at? Would it be easy for someone to get my code? Would it be as usable as a local repo for me?
|
# ? Nov 9, 2015 01:27 |
|
Use BitBucket if you want hosted Mercurial repos.
|
# ? Nov 9, 2015 02:19 |
|
mobby_6kl posted:Has anyone used hgweb? I want to stick it (or something similar) on my web hosting to publish some of my coding projects as part of my resume/portfolio. The hgweb/hgwebdir interface is themable. There are several built-in themes (including one that makes hgweb look like a gitweb repo), and the themes are relatively easy to fiddle with on your own. Yes, you can clone directly from hgwebdir URLs. Supposedly you can configure hgweb to accept pushs as well, but I've never bothered, because it's easy to leave the web interface read-only and have separate push and pull paths for a clone: code:
MrPablo fucked around with this message at 02:48 on Nov 9, 2015 |
# ? Nov 9, 2015 02:45 |
|
Just screwing around with Git, trying to learn more about administering a central repository for a small dev team. Got a couple questions- - I've got an update hook that looks something like this (paraphrasing, wrong computer) to stop pushes to master: code:
- Say someone commits a couple times to master in their repo before realizing they're not supposed to push that. What's the 'right' way to fix this? I was thinking a rebase of some sort to get their commits onto their develop branch, delete their master branch, then push develop, but rebasing is still foreign loving witchcraft to me - If a series of commits becomes unreachable--say by someone deleting an experimental branch without merging it anywhere--what happens to those commits? Do they just stay there taking up space and being mostly inaccessible forever? (edit: just a background note, we're all coming off of ClearCase if that gives you any indication of how lost in the woods we collectively are ) (edit) One more, kind of a policy question--is it typical to let finished topic branches sit around forever on the central repo once they're merged in to develop or wherever, or do you delete the branches for cleanliness' sake? Ciaphas fucked around with this message at 18:34 on Nov 10, 2015 |
# ? Nov 10, 2015 18:27 |
|
quote:- Say someone commits a couple times to master in their repo before realizing they're not supposed to push that. What's the 'right' way to fix this? I was thinking a rebase of some sort to get their commits onto their develop branch, delete their master branch, then push develop, but rebasing is still foreign loving witchcraft to me If they forgot to even start working on the feature branch, they can just rearrange the branch heads. quote:Start (but does not check out) a new branch named "feature" pointing to the current commit: If they made some commits on feature, then switched to master and made more commits that they meant to make on feature, a cherry-pick may be easier than a rebase: quote:Check out destination branch quote:- If a series of commits becomes unreachable--say by someone deleting an experimental branch without merging it anywhere--what happens to those commits? Do they just stay there taking up space and being mostly inaccessible forever? They stick around (and are reachable using the hash, which you can get with the reflog) for a while, but are eventually automatically cleaned up. quote:(edit) One more, kind of a policy question--is it typical to let finished topic branches sit around forever on the central repo once they're merged in to develop or wherever, or do you delete the branches for cleanliness' sake? I delete the branches, but I don't know how universally true that is.
|
# ? Nov 10, 2015 18:55 |
|
ToxicFrog posted:I delete the branches, but I don't know how universally true that is. I believe its all over the place. For example, some people in my company delete branches after merging; others leave them around for ever! I recently went through and pruned a bunch of merged branches and killed off ~8k of them. But it doesn't really matter with how cheap branches are if you have a decent scheme for naming them.
|
# ? Nov 11, 2015 00:32 |
|
I delete stale branches in central repos occasionally so that git gc can delete commits that only occur in those branches.
|
# ? Nov 11, 2015 01:39 |
|
Blinkz0rz posted:Use BitBucket if you want hosted Mercurial repos. MrPablo posted:The hgweb/hgwebdir interface is themable. There are several built-in themes (including one that makes hgweb look like a gitweb repo), and the themes are relatively easy to fiddle with on your own. Yes, you can clone directly from hgwebdir URLs. Got this working with CGI. Not exactly how I'd like it, probably, but good enough. No push for me either so far, I just manually copied the relevant directories. By far the biggest problem is actually cleaning up my extremely unprofessional commit notes before this can be shown to anyone
|
# ? Nov 11, 2015 02:07 |
|
mobby_6kl posted:Thanks, I'll look into this but for now hgweb seemed to be the path of least resistance. Wtf? Sign up for an account then start pushing code. It's not rocket science.
|
# ? Nov 11, 2015 02:31 |
|
Blinkz0rz posted:Wtf? Sign up for an account then start pushing code. It's not rocket science. I want to host it myself
|
# ? Nov 11, 2015 08:59 |
|
mobby_6kl posted:I want to host it myself that's silly, and not worth the trouble
|
# ? Nov 11, 2015 16:07 |
|
I've got 2 large web farms running just about every stack imaginable. Almost enough skilled humans and more than enough monitoring services to look after and maintain these things properly. We still host all of our sources in bitbucket, it just isn't worth the care and feeding.
|
# ? Nov 11, 2015 16:50 |
|
Ciaphas posted:
Its probably worth checking out gitolite, it's not too hard to configure and it saves you having to add full user accounts to your git server for everyone or messing with whatever git-shell is. It also lets you set permissions like that without a million git hooks.
|
# ? Nov 11, 2015 17:56 |
|
I know, its not based on some cost/benefit analysis, hence the downs smilie. But I already set up the whole site and want this to be part of it rather than going with an external service. But considering I only need this to show off a handful of hobby-level projects, it was very straightforward to get what I want. Maybe even easier/faster than signing up for bitbucket, it's literally one CGI script and one config file with a list of repositories.
|
# ? Nov 11, 2015 18:42 |
mobby_6kl posted:I know, its not based on some cost/benefit analysis, hence the downs smilie. But I already set up the whole site and want this to be part of it rather than going with an external service. But considering I only need this to show off a handful of hobby-level projects, it was very straightforward to get what I want. Maybe even easier/faster than signing up for bitbucket, it's literally one CGI script and one config file with a list of repositories. You are completely ignoring the ongoing maintenance going forward, backups, etc etc. Bitbucket is a no brainer dude!
|
|
# ? Nov 12, 2015 00:04 |
|
As far as I can tell, this commit to git screwed up one of my personal repos: http://git.kaarsemaker.net/git/commit/33cfccbbf35a56e190b79bdec5c85457c952a021/quote:submodule: allow only certain protocols for submodule fetches Caveat: I don't understand submodules, and generally have no idea what I'm doing. I have a personal repo of dotfiles that also includes as submodules all the git and hg repos that I would usually clone and use on a new machine or even just symlink one file from. This includes both git and hg repos, which I previously had accomplished by using git-remote-hg and the "hg::" transport. However, it now appears that transports cause some security risk and are disabled. I get this error when I try to update the submodule: code:
Anyone know anything about the whitelist? Or have some other workaround?
|
# ? Nov 12, 2015 04:22 |
|
SurgicalOntologist posted:Anyone know anything about the whitelist? Or have some other workaround? Put export GIT_ALLOW_PROTOCOL=file:git:http:https:ssh:hg somewhere in your site wide configuration, and find someone who complaining at will cause the git maintainers to do something about it.
|
# ? Nov 12, 2015 08:15 |
|
Thanks!
|
# ? Nov 12, 2015 19:33 |
|
Edison was a dick posted:Assuming you're running git from a command-line you can pass --date=$timestamp to the git commit command when you commit each revision. From a while back, but thanks. I was able to do what I wanted by setting the GIT_AUTHOR_DATE and GIT_COMMITTER_DATE environment variables. Setting both timestamps allowed me to export my old wiki pages with proper timestamps all the way back to 2004! Next I would like to merge this repository of legacy wiki pages into a newer repository of Markdown-based pages. All the files are plain text and neither repo has any branches. None of the filenames overlap. Ideally I would like the unified repo to appear as one unbroken history all the way back to the beginning. I saw this answer on Stack Overflow but there are a lot of answers and it talks about merging the newer repo into a subdirectory. I'd rather have it all mixed up together. Is there a way to do what I'm trying to do?
|
# ? Jan 5, 2016 03:51 |
|
git format-patch $initial-rev-hash --stdout > file; cd otherrepo; git am file format-patch and a text editor (or sed) is rarely the most elegant way to do something, but is a viable solution to a pretty hilariously large number of git questions.
|
# ? Jan 5, 2016 04:21 |
|
I just started using git recently. I think I broke something, but I'm not sure how. What I wanted to do was revert my local copy to an old known working version. What I did was git reset --hard (version hash). That version didn't work either, so I double-checked by going back to an even older version. Now the newer version is gone from the git log and my github. What did I do? Thankfully, I copied a recent version of all of the files I've been working on to a different folder on my machine, but I really don't want to make this mistake again.
|
# ? Feb 2, 2016 21:09 |
|
22 Eargesplitten posted:I just started using git recently. I think I broke something, but I'm not sure how. What I wanted to do was revert my local copy to an old known working version. What I did was git reset --hard (version hash). That version didn't work either, so I double-checked by going back to an even older version. Now the newer version is gone from the git log and my github. What did I do? You moved the branch back to an earlier commit. Everything after that commit was "gone". You're basically saying "move the branch pointer back to this point". You could have grabbed the later commit hash from the reflog and reset to it. What you probably wanted to do was checkout the older commit, not reset to it. New Yorp New Yorp fucked around with this message at 21:26 on Feb 2, 2016 |
# ? Feb 2, 2016 21:23 |
|
If you had more recent code on github and lost it, you must have force pushed. There's a reason git gives you scary warnings about doing that: it's almost never the correct thing to do.
|
# ? Feb 2, 2016 21:27 |
|
I've been writing this post for about 15 minutes now as I keep thinking of new things. It looks like I probably just didn't push the commit yesterday, and my commit before that only changed files in a subfolder, so at first I thought I had lost all of the commits on github. I was wrong, I reset back to the most recent commit locally and now I'm going to push to github. That was scary, but thankfully didn't actually break anything.
|
# ? Feb 2, 2016 21:51 |
|
One of the nice things about git is that it's difficult to actually lose data no matter what you do. Even if you're going around resetting and forcing left and right there's always the reflog until garbage collection occurs.
|
# ? Feb 2, 2016 22:21 |
|
To expand on this somewhat, when you rewind the branch with "git reset", it changes what commit the branch name refers to -- but it doesn't actually destroy the commits that it no longer sees. They just aren't directly accessible. If you know the hash, you can do anything you like to them (git log, git checkout, create a new branch/tag at that commit, etc). If you don't know the hash, git has a tool for finding that out: git reflog. This shows where the branch head used to be. Unlike git log, it doesn't rely on the commit info for this, but on a separate log of operations -- so it works across things like reset and rebase. That gets you the hash. For example: code:
|
# ? Feb 3, 2016 16:08 |
|
There's probably an answer out there for this, but I can't find it, I'm probably googling the wrong thing. I tried to commit without a message, and it gave a long message starting with "# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed:" Learn Git says to type my message in at the top, but it won't let me type anything. What am I doing wrong? E: Thanks for the information in the last post.
|
# ? Feb 4, 2016 23:22 |
|
22 Eargesplitten posted:There's probably an answer out there for this, but I can't find it, I'm probably googling the wrong thing. I tried to commit without a message, and it gave a long message starting with How do you mean it won't let you type anything? Are you in vi in command mode and trying to edit?
|
# ? Feb 4, 2016 23:27 |
|
I'm in Git Bash on windows and after that message came up, it won't respond to my typing. I did this the first time I tried to commit anything and just exited out and did it again correctly, but I'd like to know how to get out of it without doing that. This is what I'm getting, with the list of files I'm committing underneath.
|
# ? Feb 4, 2016 23:32 |
|
It's probably vim. Try hitting i to go into edit mode, type some stuff, then hit Escape to exit edit mode. Then type :wq (or :x), which you should see at the bottom of the terminal, and hit Enter to save and exit.
|
# ? Feb 4, 2016 23:34 |
|
|
# ? May 13, 2024 09:42 |
|
:wq did it, thanks. Yet another question. My master branch on github is extremely messy. Is it possible to delete the contents for the current commit and push the new, cleaned up folder? I already branched the current version off in case I end up needing something from it.
|
# ? Feb 4, 2016 23:43 |