dvcs

git: how do I merge between branches while keeping some changesets exclusive to one branch?

南楼画角 提交于 2019-12-03 18:43:56
问题 There's a special place in hell for people who hardcode absolute paths and database credentials into multiple random places in web applications. Sadly, before they go to hell they're wreaking havoc on Earth. And we have to deal with their code. I have to perform a few small changes to one of such web applications. I create a new branch features , and perform a global find & replace to update the paths and credentials to my local environment. I commit that. I also tag this as local . I merrily

How to manage a hierarchy of committers (like Linux kernel dev)

送分小仙女□ 提交于 2019-12-03 17:36:38
I'm a committer on a project with a GitHub repo. I have a small team of developers who can't read from or commit to that repo. I'd like to setup a git server they can commit to that is a clone of the GitHub repo. When they make commits, I will review them, sometimes make edits, then push to the GitHub repo. My question is, since I'll sometimes be altering their commits, what is the best workflow for pulling changes from GitHub back to my clone server so that everyone's history doesn't get messed up? EDIT: To clarify, I don't necessarily mean that commits will be edited. But I may need to

Git push complaining about non-fast-forward, even though remote has been pulled

只愿长相守 提交于 2019-12-03 16:46:40
I'm trying to push my changes to a repo on my NAS. It's failing in a way I don't understand. The documentation states that by default push works only with fast-forward updates. Fair enough. So I do a git pull (my remote is called rubix ): D:\RoboCup\Dev\TinMan>git pull rubix master From ssh://rubix/volume1/git/TinMan * branch master -> FETCH_HEAD Already up-to-date. All looks well. Let's try pushing... D:\RoboCup\Dev\TinMan>git push rubix master To ssh://dnoakes@rubix/volume1/git/TinMan ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'ssh://dnoakes@rubix

In git, what are some good conventions to format multiple comments to a single commit

六眼飞鱼酱① 提交于 2019-12-03 16:09:22
I was wondering how people normally separate out the multiple comments in a single commit. Stars? Commas? Separate lines? Just wondering what you find to be the best. I'm using this now when I add comments via Emacs, but not sure I like it: Added error messaging Cleaned up sign-up UI Added recaptcha # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Committer: Conrad Chu <chuboy@conradlaptop.local> # # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified:

Version-controlled extension configuration in Mercurial

 ̄綄美尐妖づ 提交于 2019-12-03 14:39:21
Normally, I would enable extensions by adding the following to .hg/hgrc : [extensions] hgext.win32text= [encode] ** = cleverencode: [decode] ** = cleverdecode: However, I want this configuration to be versioned, i.e. part of the repository, so that it is enabled for anyone else (coworkers, build machines) cloning the repository. Note that whomsoever clones the repository should not be required to do anything to enable these extensions. It appears it is not possible from the documentation , but does anyone know any neat tricks that can help me here? You want mercurial to do something

Change threshold on the similarity index for git merge with renaming involved (like -M[n] --find-renames[=n] on diff)

走远了吗. 提交于 2019-12-03 12:29:17
We have some configuration options for the rename detection heuristics during diff ( log , show ) and merge : diff.renameLimit The number of files to consider when performing the copy/rename detection; equivalent to the git diff option -l. diff.renames Tells git to detect renames. If set to any boolean value, it will enable basic rename detection. If set to "copies" or "copy", it will detect copies, as well. merge.renameLimit The number of files to consider when performing rename detection during a merge; if not specified, defaults to the value of diff.renameLimit. Also we have an option to

How to make mercurial ignore all hidden files?

那年仲夏 提交于 2019-12-03 12:03:25
问题 I hate seeing nearly every directory in my repository list each file twice, once with a dot in front of it and once without. I tried adding .* to my .hgignore file, but it has no effect. Is this the wrong syntax, and more importantly, is it a bad idea to try this in the first place? Thanks. 回答1: You've got almost the right answer in the comments from gavinb, but the match was a little to broad. However, key concept about ignoring after the face was provided by RogerPage, again in a comment

Is a DVCS useful for one developer?

自闭症网瘾萝莉.ら 提交于 2019-12-03 11:31:26
问题 Or would a conventional client-server VCS be more appropriate? I'm currently using TortoiseSVN, but I'm interested in a DVCS, but I'm not sure if it's even a good idea to try to use something like that solo. 回答1: Since you can still push to another machine also running Git/Mercurial/Bzr/etc you still have the multi-computer backup safety, which you'd hopefully have either way. However if you ever code while traveling, having full repository access can be a huge plus, then just resync to your

Moving master head to a branch

一个人想着一个人 提交于 2019-12-03 11:13:38
I have several feature branches and a master branch. Feature2 is done. Normally I would rebase (working with a remote SVN repo and would like to keep the history, so no regular merge) and ff-merge. But since master hasnt changed since I branched, I would like to move the master head (at E ) to G . Using git branch -f master G does not result in any visible changes, I assumed this is because G is on a different branch. Is it safe to use git update-ref -f master G here instead? Should I stick with rebase/ff-merge? Something even better? feature1 C-D / master A-B-E \ feature2 F-G Thank you. A

Is there implementation of Git in pure Python?

谁都会走 提交于 2019-12-03 11:09:36
Is there implementation of Git in pure Python? Found Dulwich : Dulwich is a pure-Python implementation of the Git file formats and protocols. The project is named after the village in which Mr. and Mrs. Git live in the Monty Python sketch. Looks like a low-level library, the API did not appear friendly to my eyes, but there's a tutorial on the Github page I know that this question is rather old, but I just thought I would add this for the next guy. The accepted answer mentions Dulwich and mentions that it is rather low-level (which is also my opinion). I found gittle which is a high-level