dcommit

How can I avoid an accidental dcommit from a local branch

北慕城南 提交于 2020-01-19 12:42:19
问题 Sometimes, I create local branches in git, and I'd like to get a warning message when I try to dcommit from them. How can I prevent myself from accidentally dcommiting from a local branch? 回答1: An alternative to pre-commit hooks, if you're using Linux (or Git bash or Cygwin or similar), is to wrap git in a shell helper function. Add the below to your ~/.bashrc (for bash, Git bash) or ~/.zshrc (for zsh) file, or whatever the equivalent is for your shell: real_git=$(which git) function git { if

git-svn dcommit fails because the repository name contains a space

眉间皱痕 提交于 2019-12-07 17:38:53
问题 When attemping to git svn dcommit to a repository that has spaces in it's name, I get the following error: Committing to http://svn.kuluvalley.com/Meet the Expert/trunk ... http://svn.kuluvalley.com/Meet the Expert/trunk Filesystem has no item: '/!svn/bc/7397/Meet' path not found at /usr/libexec/git-core/git svn line 592 It looks like git svn doesn't support directories with spaces in them. 回答1: I believe the problem with spaces is fixed in Git >= 1.8.0 (See: #786942). So you should consider

git-svn dcommit fails because the repository name contains a space

筅森魡賤 提交于 2019-12-05 22:02:27
When attemping to git svn dcommit to a repository that has spaces in it's name, I get the following error: Committing to http://svn.kuluvalley.com/Meet the Expert/trunk ... http://svn.kuluvalley.com/Meet the Expert/trunk Filesystem has no item: '/!svn/bc/7397/Meet' path not found at /usr/libexec/git-core/git svn line 592 It looks like git svn doesn't support directories with spaces in them. I believe the problem with spaces is fixed in Git >= 1.8.0 (See: #786942 ). So you should consider to upgrade it. See GitHub Home page: https://github.com/git/git Karl I was able to work around the problem

Combine local Git commits into one commit for git-svn

梦想与她 提交于 2019-12-03 01:43:21
问题 Currently, when I run git svn dcommit git creates a separate commit in SVN for every local commit I've made since last syncing with SVN. Is there any way for dcommit to instead combine all my recent local commits into one commit for SVN? 回答1: git rebase remotes/trunk --interactive should bring you to the menu where you can pick commits or squash them all into 1 commit in order to avoid polluting your svn repository. This is a really good (but short) resource on working with git-svn. 回答2: No,

Combine local Git commits into one commit for git-svn

别来无恙 提交于 2019-12-02 15:12:44
Currently, when I run git svn dcommit git creates a separate commit in SVN for every local commit I've made since last syncing with SVN. Is there any way for dcommit to instead combine all my recent local commits into one commit for SVN? git rebase remotes/trunk --interactive should bring you to the menu where you can pick commits or squash them all into 1 commit in order to avoid polluting your svn repository. This is a really good (but short) resource on working with git-svn. No, but you can squish all the commits together pretty easily. For the following example, I'm going to assume you're

How can I avoid an accidental dcommit from a local branch

自作多情 提交于 2019-11-28 11:14:01
Sometimes, I create local branches in git, and I'd like to get a warning message when I try to dcommit from them. How can I prevent myself from accidentally dcommiting from a local branch? An alternative to pre-commit hooks, if you're using Linux (or Git bash or Cygwin or similar), is to wrap git in a shell helper function. Add the below to your ~/.bashrc (for bash, Git bash) or ~/.zshrc (for zsh) file, or whatever the equivalent is for your shell: real_git=$(which git) function git { if [[ ($1 == svn) && ($2 == dcommit) ]] then curr_branch=$($real_git branch | sed -n 's/\* //p') if [[ ($curr