version-control

Git : How to restrict tag push

你。 提交于 2019-12-13 02:27:09
问题 Is there any way to restrict people from pushing tags in git repository ? In bitbucket under "branch management" there is an option to allow branch access , but by disabling it even code push is failing. Thanks in advance for your help. 回答1: You may write some git update hook: #!/bin/sh if [ $USER != "git-repo-admin" ]; then if [ "$1" == refs/tags/* ]; then echo "Tag push is restricted" exit 1 fi fi 来源: https://stackoverflow.com/questions/35335787/git-how-to-restrict-tag-push

How to track third-party sources with ClearCase without a headache?

旧街凉风 提交于 2019-12-13 02:22:41
问题 First of all: I am not an experienced ClearCase user, but I have lots of experience with other VCS and *nix command-line tools. WIth ClearCase, I use command-line tool ("cleartool") working in a Unix shell. Problem: I have a small set of sources stored in the ClearCase. Once in a while a fresh .tgz with the same sources comes in and I have to update sources in the repository (process could not be changed so that other party will use ClearCase). Now I do the following: Extract tgz into, say, "

How to get hudson's git plugin to clone repo with the name of the repo in the path?

两盒软妹~` 提交于 2019-12-13 02:17:04
问题 Let's say I have a repo called "stuff". git@github.com:mine/stuff.git when I do a git clone of this repo from the command line, it creates a directory called "stuff" and puts everything in that directory. When I set up hudson to use git, it puts everything in the directory $hudson_home/jobs/myjob/workspace/* with no "stuff" after workspace. Just the items inside of stuff. How can I make hudson clone the repo like the commandline does, namely: $hudson_home/jobs/myjob/workspace/stuff/* I see no

How to reference remote repositories in a git alias?

痞子三分冷 提交于 2019-12-13 02:13:43
问题 How can one reference a git alias to perform an operation on the equivalent tracking branch on a remote repository called "origin"? For example, if I am on branch "foo" of my local repo, and I want to run a command that normally defaults to my "origin/foo" branch, how can I do so? Here is a concrete example: I want to see the incoming commits from my "origin/foo" branch, and I am on my local "foo" branch. To do so, I would run git fetch && git log --pretty=oneline --abbrev-commit ..origin/foo

Is there a better way to keep your own copy of a customized open source project?

对着背影说爱祢 提交于 2019-12-13 01:25:16
问题 I use an open source project to host a site (OrchardCMS) which is available in a GIT repository via CodePlex. I have made a few customizations to the source code that are specific to my implementation and I want to keep preserved and under source control. However the challenge arises when there's a new release of the source engine. My changes certainly won't go into the blessed repository everyone uses. Currently I'm using two repositories. I use the CodePlex OrchardCMS repository to get the

Rename multiple names and emails in a single pass of git-filter-branch

荒凉一梦 提交于 2019-12-13 01:04:20
问题 Is it possible to mass-rename 2 or more email addresses with a single pass of git filter-branch ? I tried adapting the code from this answer by just duplicating the if..fi clause : git filter-branch --commit-filter ' if [ "$GIT_COMMITTER_NAME" = "<Old Name 1>" ]; then GIT_COMMITTER_NAME="<New Name 1>"; GIT_AUTHOR_NAME="<New Name 1>"; GIT_COMMITTER_EMAIL="<New Email 1>"; GIT_AUTHOR_EMAIL="<New Email 1>"; git commit-tree "$@"; else git commit-tree "$@"; fi if [ "$GIT_COMMITTER_NAME" = "<Old

Git: Auto commit contents of a windows folder

孤街浪徒 提交于 2019-12-13 00:58:48
问题 We have a shared folder on our network. Is there a way to auto commit and push the changes of the folder (say every hour) to the remote Stash repository? Thanks. 回答1: There's a bunch of opensource tools to do git autocommit. However, they solve a slightly different task: making a commit just after a change is detected. https://github.com/mvgrimes/git-autocommit https://github.com/riddochc/git-autocommit Also, you can make a batch file and schedule it to run each hour: #!/bin/sh cd path/to

Perforce to Git: Invalid option: -r

扶醉桌前 提交于 2019-12-13 00:22:43
问题 I am trying to migrate a project from Perforce into Git. I am using git-p4 as my main tool to do the heavy lifting for me, and it comes by default with Git on Windows: C:\Program Files\Git\mingw64\libexec\git-core\git-p4 . Following Migrating Perforce to Git in Windows, I have reached the step where I execute my cloning command: git p4 clone <PerforceRepo> (where p4 is an alias for the file git-p4.py) I keep getting error: Invalid option: -r. C:\P4-To-Git>git p4 clone //depot/C:\build

Migrate TFVC repository from one VSTS instance to another VSTS instance

拟墨画扇 提交于 2019-12-13 00:20:11
问题 I need to move, or copy, a TFVC (Team Foundation Version Control) repository from one instance of VSTS (e.g.: source.visualstudio.com) to another instance of VSTS (e.g.: destination.visualstudio.com). I thought this would fairly straightforward, but I can only find information in regards to TFS (Team Foundation Server), not VSTS (Visual Studio Team Services). Or samples that convert to a Git repository, while I need to go from TFVC to TFVC. I am not interested in migrating Work Items at this

Multiple projects in a solution vs. multiple projects in source control

假如想象 提交于 2019-12-12 20:41:03
问题 After adopting Kiln a year or so back, I've been sticking to the convention of having one source control project per one visual studio project. While I find this keeps the commits nice and simple and the source control project very focused, its starting to lead to a LOT of commits for what's essentially one change. Example: One of my visual studio solutions is setup like this: App.Core (service layer) App.Core.Tests( testing layer) App.Web.Core (controllers ) App.Web.UI (views/js/etc..) App