配置git commit时选择author

背景:

一个Linux服务器,git clone了一份代码,多个developer使用mintty连接后,都要修改某个文件。

想要在developer进行git commit时要选择自己的身份。

过程:

1.使用 git config --global --unset user.name 和 user.email 取消了全局的配置

2.在本地仓库中,使用 git config --add user.name 和 user.email 命令添加了多个user。但是在执行 git commit 操作时,发现选了最下面的user作为author。

问题:

请问:怎样配置才能让每个developer在commit时,强制选择或者输入author?

2个回答

配置一个Gerrit服务可以达到你的目的, gerrit 可以限制在push的时候只能push自己作为作者的COMMENT(默认情况就有这种限制)。

一般要手动输入,git config --add user.name, git config --add user.email,配置文件 在.git下配置config

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
来自php的git commit将无法正常工作

<div class="post-text" itemprop="text"> <p>I have a simple php script that execute a git commit action on a local git repo. It used to work great but since i moved to new server it stopped working. The exec response code is 128 and the output is blank.</p> <p>My first thought was directory permissions or ownership, but I've tried everything and it doesn't help. Anyone have any idea what could be the problem or a way to identify the error better ?</p> <p>This is a test code that reproduce the problem: </p><pre><code>$repoName = 'test'; $dirpath = __DIR__; if (! file_exists($dirpath . DIRECTORY_SEPARATOR . $repoName)) { mkdir($dirpath . DIRECTORY_SEPARATOR . $repoName, 0777, true); } exec('git init ' . $repoName); $dirpath .= DIRECTORY_SEPARATOR . $repoName; chdir($dirpath); file_put_contents($dirpath. DIRECTORY_SEPARATOR . '.gitkeep', ''); file_put_contents($dirpath. DIRECTORY_SEPARATOR . 'realFile.txt', 'this is a test'); exec('git add -A'); exec('git commit -a --author="user &lt;user&gt;" -m "test message"', $output, $returnCode); echo "return code $returnCode&lt;br/&gt;"; echo "output:&lt;br/&gt;"; var_dump($output); </code></pre> </div>

commit message带引号,clang 编译出错

使用git commit becf7bfd4d8b3d8858d0b94f779d1b690248c11a Author: tug <tug@skyth-tek.com> Date: Sat May 21 13:28:10 2016 +0800 "a test" 提交如上,提交名为 "a test " 编译时候就会报错: target thumb C++: libsurfaceflinger <= frameworks/native/services/surfaceflinger/Client.cpp clang++: error: no such file or directory: 'test"' 提交名没有" ",就能编译通过。 clang编译怎么会和我的commit message有关联?

git项目的问题 望大神解惑

IDEA里面add和 add directory有什么区别么 为什么我感觉一样呢 ![图片说明](https://img-ask.csdn.net/upload/201703/24/1490332662_428559.png)

android studio git提交人的姓名在哪里改啊?

![图片说明](https://img-ask.csdn.net/upload/201702/15/1487143853_416612.png)

使用git2go添加并提交新文件

<div class="post-text" itemprop="text"> <p>I am currently struggling to stage and commit a file to a git repository in memory (i.e. without writing a file to disk, adding and committing it)</p> <p>Here's a shortened version of my code; it <em>almost</em> works</p> <pre><code>package main import ( "fmt" "gopkg.in/libgit2/git2go.v25" "time" ) func main() { sig := &amp;git.Signature{ Name: "Some Person", Email: "somebody@something.org", When: time.Now(), } repo, err := git.OpenRepository("./repo") check(err) defer repo.Free() content := []byte("hello world") index, err := repo.Index() check(err) oid, err := repo.CreateBlobFromBuffer(content) check(err) ie := git.IndexEntry{ Mode: git.FilemodeBlob, Id: oid, Path: "documents/document_9.md", } err = index.Add(&amp;ie) check(err) treeId, err := index.WriteTree() check(err) tree, err := repo.LookupTree(treeId) check(err) index.Write() currentBranch, err := repo.Head() check(err) currentTip, err := repo.LookupCommit(currentBranch.Target()) check(err) commitId, err := repo.CreateCommit("HEAD", sig, sig, "A new commit", tree, currentTip) check(err) fmt.Println(commitId) } func check(err error) { if err != nil { panic(err) } } </code></pre> <p>However, when I run it and look in <code>./repo</code>, something's not quite right. As you can see from <code>git status</code>, the new <code>document_9.md</code> file is marked as being deleted (i.e. git knows about it but it's not present)</p> <pre><code>❯ git status On branch master Changes not staged for commit: (use "git add/rm &lt;file&gt;..." to update what will be committed) (use "git checkout -- &lt;file&gt;..." to discard changes in working directory) deleted: documents/document_9.md </code></pre> <p>Looking at the log, it's confirmed that the commit actually worked:</p> <pre><code>❯ git log --patch commit a609b43e6a3f7da7d0589971ab0f64f3f432e76c Author: Some Person &lt;somebody@something.org&gt; Date: Thu Mar 23 19:43:56 2017 +0000 a new commit diff --git a/documents/document_9.md b/documents/document_9.md new file mode 100644 index 0000000..95d09f2 --- /dev/null +++ b/documents/document_9.md @@ -0,0 +1 @@ +hello world \ No newline at end of file commit 668762279b51483c05dbdedcf3c599a1b41c203b Author: Original Committer &lt;someguy@something.com&gt; Date: Thu Mar 23 19:42:52 2017 +0000 First commit diff --git a/documents/docment_1.md b/documents/docment_1.md new file mode 100644 index 0000000..2965834 --- /dev/null +++ b/documents/docment_1.md @@ -0,0 +1 @@ +# Hello World </code></pre> <p>I believe that I'm missing a step. Somehow I need to ensure that my commit is 'synced' with the filesystem. I <em>thought</em> that (based on the documentation), this was achieved by <code>index.Write()</code> and <code>index.WriteTree()</code>, but I can't get it to work.</p> <p>Any nudge in the right direction would be much appreciated.</p> </div>

git2go:列出具有最新提交者和提交日期的文件

<div class="post-text" itemprop="text"> <p>I'm attempting to use git2go to output a list of files, along with their latest author and most recent commit date in a repository. Looping through the files with <code>tree.Walk</code> seems to be straightforward:</p> <pre><code>package main import ( "time" "gopkg.in/libgit2/git2go.v25" ) // FileItem contains enough file information to build list type FileItem struct { AbsoluteFilename string `json:"absolute_filename"` Filename string `json:"filename"` Path string `json:"path"` Author string `json:"author"` Time time.Time `json:"updated_at"` } func check(err error) { // ... } func getFiles(path string) (files []FileItem) { repository, err := git.OpenRepository(path) check(err) head, err := repository.Head() check(err) headCommit, err := repository.LookupCommit(head.Target()) check(err) tree, err := headCommit.Tree() check(err) err = tree.Walk(func(td string, te *git.TreeEntry) int { if te.Type == git.ObjectBlob { files = append(files, FileItem{ Filename: te.Name, Path: td, Author: "Joey", // should be last committer Time: time.Now(), // should be last commit time }) } return 0 }) check(err) return } </code></pre> <p>What I can't work out is, which approach do I take? Can I, inside the function passed to <code>tree.Walk</code>, work out the commit based on the limited information of the <code>git.TreeEntry</code>? Or do I need to separately construct a list of commits along with associated files and somehow cross-reference them?</p> </div>

GRAV git-sync插件更新崩溃网站,有没有遇到/解决过?

<div class="post-text" itemprop="text"> <p>I've been using GRAV as a CMS for a small experimental site. I recently updated the git-sync plugin, and am suddenly stuck with a website that produces only errors, with no way to enter the admin gui (all web access to the site crashes with same errors), to downgrade the git-sync module, or for that matter, to upgrade the git-sync plugin if there is a fix. </p> <p>I'm a developer that hasn't really thought much about web development in decades (my, how it's changed), so there are a few things I have to admit upfront. I don't know sht about php, and really don't care to if I don't have to.</p> <p>The message I get (below) indicates that this is a php error. If this is a simple syntax fix please give me a heads up. </p> <p>If you have any advice on a "cli" way to use the git-sync plugin to upgrade or downgrade, revert the git-sync, or any other hints, advise away. I'll dig in to more documentation and see if I end up answering my own question.</p> <pre><code>/[pathToUserHome]/grav/user/plugins/git-sync/classes/GitSync.php */ $paths = ['.']; if (version_compare($version, '2.0', '&lt;')) { $add .= ' --all'; } return $this-&gt;execute($add . ' ' . implode(' ', $paths)); } public function commit($message = '(Grav GitSync) Automatic Commit') { $authorType = $this-&gt;getGitConfig('author', 'gituser'); if (defined('GRAV_CLI') &amp;&amp; in_array($authorType, ['gravuser', 'gravfull'])) { $authorType = 'gituser'; } // get message from config, it any, or stick to the default one $message = $this-&gt;getConfig('git', null)['message'] ?? $message; // get Page Title and Route from Post $pageTitle = $_POST['data']['header']['title']??'NO TITLE FOUND'; $pageRoute = $_POST['data']['route']??'NO ROUTE FOUND'; ... Arguments 1) "syntax error, unexpected '?'" Whoops\Exception\ErrorException… /user/plugins/git-sync/classes/GitSync.php : 223 $message = $this-&gt;getConfig('git', null)['message'] ?? $message; </code></pre> </div>

如何从git日志解析响应? 我需要获取提交哈希和提交消息

<div class="post-text" itemprop="text"> <p>I am executing a command "git log" from php using shell_exec() function and getting the following response. How can i parse the response and get the commit hash and commit message ?</p> <pre> commit baedfa411c58584c4a98f3a632b7f3231500f92c Author: XYZ Date: Tue Apr 12 23:04:33 2016 +0530 commiting 3rd commit commit 251654c5f6f256fe6e23c2c85f1a70594aae00d4 Author: XYZ Date: Tue Apr 12 22:37:21 2016 +0530 commiting 2nd commit commit 3be3198a20d902e24e6b187cd0666ed0d5ee6c4d Author: XYZ Date: Tue Apr 12 22:34:31 2016 +0530 initial commit </pre> </div>

preg_match_all with git log --pretty = raw --all

<div class="post-text" itemprop="text"> <p>I'm trying to use <code>preg_match_all</code> to process the log from <code>git log --pretty=raw --all</code>.</p> <p>The sample data I got is something like this:</p> <pre><code>commit 5650c7841f72c4c65689b0d4bc83ccd70e5b2362 (HEAD, origin/master, origin/HEAD, master) tree 69c6036c64c805e9c335b2eadd87b43af90ee1ad parent a912fdd530efe69dae4b0f417c8a8631d68f469c parent 113e128efe54511f2b0bdd589301ffe039fc185e author Author Name 3 &lt;author.name.3@gmail.com&gt; 1371835063 -0700 committer Committer Name 3 &lt;committer.name.3@gmail.com&gt; 1371835063 -0700 Merge pull request #60 from sample/master Line 2 message commit 94e99889226671dc479be770968df2692e09db11 (origin/fixit) tree f900c172fa633b3769b982614ce639e3ee6f3b62 parent dc56687f1597b317064b0d899c2450fb6805791e author Author Name 2 &lt;author.name.2@something.com.tld&gt; 1370944188 +0300 committer Committer Name 2 &lt;committer.name.2@something.com.tld&gt; 1370944188 +0300 1 line message commit dc56687f1597b317064b0d899c2450fb6805791e tree cb1573ccde7ddcb2e54b9b9a777e11a435d532ac parent a912fdd530efe69dae4b0f417c8a8631d68f469c author Author Name 1 &lt;author.name.1@gmail.com&gt; 1370640640 +0300 committer Committer Name 1 &lt;committer.name.1@gmail.com&gt; 1370943413 +0300 Message contain words like commit tree parent author committer to screw your regex. Also contain other symbols like @ # ! % ( ) = - | Can you handle 2nd paragraph? 3rd paragraph? </code></pre> <p>`</p> <p>I would like to extract the</p> <ul> <li>commit hash</li> <li>tree hash</li> <li>parents hash</li> <li>author name</li> <li>commiter, and </li> <li>commit message</li> </ul> <p>The closest I can get is with:</p> <p><code>/^commit (.{40})(.*)\s^tree (.{40})\s^parent (.{40})\s(^parent (.{40})\s)?^author (.+)\s^committer (.+)\s+(.+)\s+/m</code></p> <p>Which come out something like this: <a href="http://regex101.com/r/cY4qV4" rel="nofollow">http://regex101.com/r/cY4qV4</a></p> <p>Is there more accurate regex for above data that don't break easily like mine?</p> <p>Something to take note:</p> <ol> <li>tags, branches in () after commit (additional question: Is it possible to separate tag/branch by comma (,) also within 1 regex?)</li> <li>some commit has 2 parents</li> <li>commit message may contains multiple paragraph, weird symbols or words that you use in regex</li> </ol> </div>

从Go'exec()'调用`git shortlog`有什么问题?

<div class="post-text" itemprop="text"> <p>I'm trying to invoke <code>git shortlog</code> from Go to grab the output, but I'm running into a wall.</p> <p>Here's a working example of how I'm able to do this with <code>git log</code>:</p> <pre><code>package main import ( "fmt" "os" "os/exec" ) func main() { runBasicExample() } func runBasicExample() { cmdOut, err := exec.Command("git", "log").Output() if err != nil { fmt.Fprintln(os.Stderr, "There was an error running the git command: ", err) os.Exit(1) } output := string(cmdOut) fmt.Printf("Output: %s ", output) } </code></pre> <p>Which gives expected output:</p> <pre><code>$&gt; go run show-commits.go Output: commit 4abb96396c69fa4e604c9739abe338e03705f9d4 Author: TheAndruu Date: Tue Aug 21 21:55:07 2018 -0400 Updating readme </code></pre> <h2>But I really want to do this with <code>git shortlog</code>.</h2> <p>For some reason... I just can't get it to work with shortlog. Here's the program again, with the only change being the git command line:</p> <pre><code>package main import ( "fmt" "os" "os/exec" ) func main() { runBasicExample() } func runBasicExample() { cmdOut, err := exec.Command("git", "shortlog").Output() if err != nil { fmt.Fprintln(os.Stderr, "There was an error running the git command: ", err) os.Exit(1) } output := string(cmdOut) fmt.Printf("Output: %s ", output) } </code></pre> <p>With empty output:</p> <pre><code>$&gt; go run show-commits.go Output: </code></pre> <p>I can run <code>git shortlog</code> directly from the command line and it seems to work fine. Checking the <a href="https://git-scm.com/docs/git-shortlog" rel="nofollow noreferrer">docs</a>, I'm led to believe the 'shortlog' command is part of git itself.</p> <p>Can anyone help point out what I could do different? </p> <p>Thanks</p> </div>

从函数返回时,内存中存储库消失

<div class="post-text" itemprop="text"> <p>I'm using <code>go-git</code> in a program and trying to test my functions. To test one function I want to first create an in-memory repository, commit a file to it and then let my function use it.</p> <p>So, in my test i wrote a helper that can create a new in-memory repo (init) in an in-memory filesystem and return it.</p> <p>But when I try to use the repo in the calling function I don't get anything.</p> <p>Here's an example reproducing the problem:</p> <pre><code>package main import ( "fmt" "os" "time" "gopkg.in/src-d/go-billy.v4" "gopkg.in/src-d/go-git.v4/config" "gopkg.in/src-d/go-git.v4/plumbing/object" "gopkg.in/src-d/go-billy.v4/memfs" "gopkg.in/src-d/go-git.v4" "gopkg.in/src-d/go-git.v4/storage/memory" ) func makeTempRepo() (*git.Repository, billy.Filesystem, error) { s := memory.NewStorage() f := memfs.New() r, err := git.Init(s, f) if err != nil { return nil, nil, fmt.Errorf("failed to create in-memory repo: %v", err) } readme, err := f.Create("/README.md") if err != nil { return nil, nil, fmt.Errorf("failed to create a file in repository: %v", err) } readme.Write([]byte("Hello world")) w, _ := r.Worktree() _, err = w.Add("/README.md") if err != nil { return nil, nil, fmt.Errorf("failed to add file to repository: %v", err) } commit, err := w.Commit("test commit", &amp;git.CommitOptions{ Author: &amp;object.Signature{ Name: "John Doe", Email: "john@does.com", When: time.Now(), }, }) if err != nil { return nil, nil, fmt.Errorf("failed to commit file to repository: %v", err) } obj, err := r.CommitObject(commit) if err != nil { return nil, nil, fmt.Errorf("failed to get commit: %v", err) } if obj == nil { return nil, nil, fmt.Errorf("commit object is nil") } fmt.Printf("%v ", obj) return r, f, nil } func clone(URL, tagPrefix string, fs billy.Filesystem) (*git.Repository, error) { r, err := git.Clone(memory.NewStorage(), fs, &amp;git.CloneOptions{ URL: URL, }) if err != nil { return nil, fmt.Errorf("failed to clone repo '%s': %v", URL, err) } err = r.Fetch(&amp;git.FetchOptions{ Force: true, RefSpecs: []config.RefSpec{ config.RefSpec("refs/*:refs/*"), config.RefSpec("HEAD:refs/heads/HEAD"), }, }) if err != nil { return nil, fmt.Errorf("failed to fetch repo '%s': %v", URL, err) } return r, nil } func main() { repo, fs, err := makeTempRepo() if err != nil { fmt.Printf("could not create temp repo: %v", err) os.Exit(1) } commits, err := repo.CommitObjects() if err != nil { fmt.Printf("unable to get commits: %v", err) os.Exit(1) } fmt.Println("commits:") for c, err := commits.Next(); err != nil; { fmt.Printf("a commit: %v ", c) os.Exit(1) } res, err := clone(fs.Root(), "foo", fs) if err != nil { fmt.Printf("unexpected error: %v", err) os.Exit(1) } h, err := res.Head() if err != nil { fmt.Printf("error getting HEAD: %v", err) os.Exit(1) } if h == nil { fmt.Println("missing HEAD commit") os.Exit(1) } fmt.Printf("HEAD: %v", h) } </code></pre> <p>And executing it gives:</p> <pre><code>$ go run main.go commit 936fa4014b70e008bf01338d1c0916e1365f77a6 Author: John Doe &lt;john@does.com&gt; Date: Fri Dec 07 12:17:39 2018 +0100 test commit commits: unexpected error: failed to clone repo '/': repository not foundexit status 1 </code></pre> <p>So, the <code>main</code> function can't list any commits from the repo nor clone it.</p> <p>What am I doing wrong?</p> </div>

我是否提交包——锁定。 由 npm 5创建的 json 文件?

<div class="post-text" itemprop="text"> <p><a href="http://blog.npmjs.org/post/161081169345/v500" rel="noreferrer">npm 5 was released today</a> and one of the new features include deterministic installs with the creation of a <code>package-lock.json</code> file.</p> <p>Is this file supposed to be kept in source control?</p> <p>I'm assuming it's similar to <a href="https://stackoverflow.com/questions/39990017/should-i-commit-the-yarn-lock-file-and-what-is-it-for"><code>yarn.lock</code></a> and <a href="https://stackoverflow.com/questions/12896780/should-composer-lock-be-committed-to-version-control"><code>composer.lock</code></a>, both of which are supposed to be kept in source control. </p> </div> <p>转载于:https://stackoverflow.com/questions/44206782/do-i-commit-the-package-lock-json-file-created-by-npm-5</p>

在Go中生成构建时间戳

<div class="post-text" itemprop="text"> <p>I want in a Go program (using Go 1.11.1 on Debian/Linux/x86-64) to keep the build timestamp with a line explaining the last <code>git commit</code>.</p> <p>In a C program (FWIW my <a href="http://github.com/bstarynk/bismon/" rel="noreferrer">bismon</a> project is doing something very similar), I would just generate some <code>_timestamp.c</code> file, e.g. with a <code>Makefile</code> recipe like:</p> <pre><code>_timestamp.c: date +'const char my_timestamp[]='%c';%n' &gt; $@ (echo -n 'const char my_lastgitcommit[]="'; \ git log --format=oneline --abbrev=12 --abbrev-commit -q | head -1 \ | tr -d ' \f\"\\\\' ; echo '";') &gt;&gt; $@ </code></pre> <p>and I would link my program <code>myprog</code> with something like:</p> <pre><code>myprog: $(MYOBJECTS) _timestamp.c $(LINK.c) $(MYOBJECTS) _timestamp.c -o $@ $(RM) _timestamp.c </code></pre> <p>Notice that <code>_timestamp.c</code> is automatically removed at each successful link. Of course in some header I would declare <code>extern const char my_timestamp[];</code> and <code>extern const char my_lastgitcommit[]:</code> and I would use e.g. <code>my_timestamp</code> and <code>my_lastgitcommit</code> in my <code>main.c</code> (and have <code>MYOBJECTS</code> contain <code>main.o</code>)</p> <p>It looks like <a href="https://golang.org/cmd/go/" rel="noreferrer"><code>go generate</code></a> could be used to behave in a similar way. I would like to have a package <code>"timestamp"</code> defining two string globals <code>timestamp.My_timestamp</code> and <code>timestamp.My_gitcommit</code> but I don't exactly understand how to do it.</p> <p>I tried to add some <code>timestamp/timestamp.go</code> file with</p> <pre><code>package timestamp //go:generate date +'var My_timestamp = "%c"%n' // Code generated - DO NOT EDIT. </code></pre> <p>But it did not change with <code>go generate</code> then <code>go install</code></p> <p>Of course, these timestamps should be constant strings at compile time, and I expect to find them when running the <a href="http://man7.org/linux/man-pages/man1/strings.1.html" rel="noreferrer">strings(1)</a> utility on the ELF executable.</p> <p>BTW, I recall one of the motivations of <a href="https://golang.org/doc/articles/go_command.html" rel="noreferrer">the <code>go</code> command</a>:</p> <blockquote> <p>An explicit goal for Go from the beginning was to be able to build Go code using only the information found in the source itself, not needing to write a makefile or one of the many modern replacements for makefiles. If Go needed a configuration file to explain how to build your program, then Go would have failed.</p> </blockquote> <p>So I am still expecting something to go into the source code alone, without extra configuration for building.</p> <p>In other words, I want to <em>generate</em> at every build a Go file similar to:</p> <pre><code>// generated timestamp.go file package timestamp var Buildtime = "Tue 30 Oct 2018 09:39:01 AM MET"; var Buildlastgitcommit = "7fde394b60bc adding timestamp.go" </code></pre> <p>The <code>Buildtime</code> string is generated by <code>date +%c</code>. The <code>Buildlastgitcommit</code> string might be generated by commands similar to what my <code>_timestamp.c</code> make rule is doing.</p> <p>I need these strings to be constant and built-in the ELF executable produced by a Go build (which I would prefer to be done by <em>usual</em> commands, either without extra arguments to <code>go build</code> or any other build automation tool, or with some way to fail the build if the mandatory arguments are forgotten; hence <a href="https://stackoverflow.com/a/53045029/841108">atanayel's answer</a> is not enough). So I want the <a href="http://man7.org/linux/man-pages/man1/strings.1.html" rel="noreferrer">strings(1)</a> utility to find these strings quickly in the executable. And the generation of such files should be configured in some kind of files, not requiring extra arguments to builders.</p> <p>I could consider switching to some other, <em>Go-friendly</em>, <a href="https://en.wikipedia.org/wiki/Build_automation" rel="noreferrer">build automation</a> system (but it seems that even with <a href="https://getgb.io/" rel="noreferrer">gb</a> I can't easily do what I want: quickly generate some simple <code>.go</code> file at every build). But I don't understand why it is so difficult to use <em>generated</em> Go files in Go programs. Generating simple code is following the <a href="https://en.wikipedia.org/wiki/Unix_philosophy" rel="noreferrer">Unix philosophy</a>, and has been practiced since many decades (e.g. see <a href="https://godoc.org/golang.org/x/tools/cmd/goyacc" rel="noreferrer">goyacc</a> inspired by the old <a href="https://en.wikipedia.org/wiki/Yacc" rel="noreferrer">yacc</a> program).</p> <p>NB: the <a href="https://docs.google.com/document/d/1V03LUfjSADDooDMhe-_K59EgpTEm3V8uvQRuNMAEnjg/edit" rel="noreferrer">rationale for <code>go generate</code></a> explicitly mentions that:</p> <blockquote> <p>It is not a goal of this proposal to build a generalized build system like the Unix <code>make(1)</code> utility. </p> </blockquote> <p>and later </p> <blockquote> <p>once things are settled, the author commits the generated files to the source repository, </p> </blockquote> <p>(and this is <em>not</em> my use case)</p> <p>PS. I only care about POSIX systems; I really don't care if my Go software cannot be built on Windows. And I tend to think that (contrarily to what <a href="https://docs.google.com/document/d/1V03LUfjSADDooDMhe-_K59EgpTEm3V8uvQRuNMAEnjg/edit" rel="noreferrer"><code>go</code> command motivation</a> explains), in my particular case, I <em>do</em> need some build automation tool. In my <a href="https://gitlab.com/bstarynk/bastawigo" rel="noreferrer">bastawigo</a> toy project (GPLv3+), I am using <code>make</code> (driving the <code>go</code> command)</p> </div>

公司网络中的PHP Composer问题

<div class="post-text" itemprop="text"> <p>I want to install Matomo (<a href="https://matomo.org/" rel="nofollow noreferrer">https://matomo.org/</a>) on Openshift. I can install a simple PHP Website without any problems. But when I try to install Matomo I get this Error in the Log when I start to build the Project. </p> <pre><code>Cloning "ssh://git@stash.mycompany.net:22/matomo/analysetool.git" ... Commit: 5f4878b33d3e7dbae65d4ef674ea71d6f3e054e9 (update composerfile) Author: Wilhelm, Tom &lt;tom.wilhelm@mycompany.com&gt; Date: Fri Nov 30 14:28:33 2018 +0100 ---&gt; Installing application source... Found 'composer.json', installing dependencies using composer.phar... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to 2001:41d0:302:1100::8:104f: Network is unreachable /usr/libexec/s2i/assemble: line 21: ./composer.phar: No such file or directory error: build error: non-zero (13) exit code from artifactory.mycompany.net/rhscl/php-70-rhel7@sha256:0277d2c99328657e80822cc4ef3e5907e1e77cd0bd672ae497c98eeff37aefbd </code></pre> <p>The Problem is that the Server my Company runs does not allow access to Files outside the Network. I think the Error comes from the composer.json File:</p> <pre><code>{ "name": "piwik/piwik", "type": "application", "description": "the leading free/libre analytics platform", "keywords": ["piwik","matomo","web","analytics"], "homepage": "https://matomo.org", "license": "GPL-3.0+", "authors": [ { "name": "The Matomo Team", "email": "hello@matomo.org", "homepage": "https://matomo.org/team/" } ], "support": { "forum": "https://forum.matomo.org/", "issues": "https://github.com/matomo-org/piwik/issues", "wiki": "https://github.com/matomo-org/piwik/wiki", "source": "https://github.com/matomo-org/piwik" }, "config":{ "platform": { "php": "5.5.9" } }, "require": { "php": "&gt;=5.5.9", "twig/twig": "~1.0", "leafo/lessphp": "~0.5.0", "symfony/console": "~2.6.0", "tedivm/jshrink": "~0.5.1", "mustangostang/spyc": "~0.5.0", "piwik/device-detector": "~3.0", "piwik/decompress": "~1.0", "piwik/network": "~0", "piwik/cache": "~1.0.0", "piwik/ini": "^1.0.6", "php-di/php-di": "^5.0.0", "psr/log": "~1.0", "monolog/monolog": "~1.11", "symfony/monolog-bridge": "~2.6.0", "symfony/event-dispatcher": "~2.6.0", "pear/pear_exception": "~1.0.0", "matomo/referrer-spam-blacklist": "~1.0", "matomo/searchengine-and-social-list": "~1.0", "tecnickcom/tcpdf": "~6.0", "piwik/piwik-php-tracker": "^1.0", "composer/semver": "~1.3.0", "szymach/c-pchart": "^2.0", "geoip2/geoip2": "^2.8", "davaxi/sparkline": "^1.1" }, "require-dev": { "aws/aws-sdk-php": "2.7.1", "phpunit/phpunit": "~4.8", "facebook/xhprof": "dev-master", "phpseclib/phpseclib": "~0.3.8", "symfony/var-dumper": "~2.6.0", "symfony/yaml": "~2.6.0" }, "repositories": [ { "type": "package", "package": { "name": "facebook/xhprof", "type": "library", "description": "XHProf: A Hierarchical Profiler for PHP", "keywords": ["profiling", "performance"], "homepage": "http://pecl.php.net/package/xhprof", "license": "Apache-2.0", "version": "master", "require": { "php": "&gt;=5.2.0" }, "autoload": { "files": [ "xhprof_lib/utils/xhprof_lib.php", "xhprof_lib/utils/xhprof_runs.php" ] }, "source": { "type": "git", "url": "https://github.com/phacility/xhprof", "reference": "master" } } } ], "scripts": { "pre-update-cmd": [ "Piwik\\Composer\\ScriptHandler::cleanXhprof" ], "pre-install-cmd": [ "Piwik\\Composer\\ScriptHandler::cleanXhprof" ], "post-update-cmd": [ "Piwik\\Composer\\ScriptHandler::buildXhprof" ], "post-install-cmd": [ "Piwik\\Composer\\ScriptHandler::buildXhprof" ] }, "autoload": { "psr-4": { "Piwik\\Plugins\\": "plugins/", "Piwik\\": "core/" }, "psr-0": { "Zend_": "libs/", "HTML_": "libs/", "PEAR_": "libs/", "Archive_": "libs/" } }, "autoload-dev": { "psr-4": { "Piwik\\Tests\\": "tests/PHPUnit/" } } } </code></pre> <p>For this Case my Company has a JFrog Artifactory (<a href="https://jfrog.com/artifactory/" rel="nofollow noreferrer">https://jfrog.com/artifactory/</a>). Now my Question is which File do I have to upload to the Artifactory and how Can I tell the Composer that he has to get the Files from the Artifactory and not from the Internet.</p> <p>Thanks in advance</p> </div>

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Linux面试题(2020最新版)

文章目录Linux 概述什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使用的进程间通信方式?Linux 有哪些系统日志文件?Linux系统安装多个桌面环境有帮助吗?什么是交换空间?什么是root帐户什么是LILO?什...

将一个接口响应时间从2s优化到 200ms以内的一个案例

一、背景 在开发联调阶段发现一个接口的响应时间特别长,经常超时,囧… 本文讲讲是如何定位到性能瓶颈以及修改的思路,将该接口从 2 s 左右优化到 200ms 以内 。 二、步骤 2.1 定位 定位性能瓶颈有两个思路,一个是通过工具去监控,一个是通过经验去猜想。 2.1.1 工具监控 就工具而言,推荐使用 arthas ,用到的是 trace 命令 具体安装步骤很简单,大家自行研究。 我的使用步骤是...

学历低,无法胜任工作,大佬告诉你应该怎么做

微信上收到一位读者小涛的留言,大致的意思是自己只有高中学历,经过培训后找到了一份工作,但很难胜任,考虑要不要辞职找一份他能力可以胜任的实习工作。下面是他留言的一部分内容: 二哥,我是 2016 年高中毕业的,考上了大学但没去成,主要是因为当时家里经济条件不太允许。 打工了三年后想学一门技术,就去培训了。培训的学校比较垃圾,现在非常后悔没去正规一点的机构培训。 去年 11 月份来北京找到了一份工...

JVM内存结构和Java内存模型别再傻傻分不清了

JVM内存结构和Java内存模型都是面试的热点问题,名字看感觉都差不多,网上有些博客也都把这两个概念混着用,实际上他们之间差别还是挺大的。 通俗点说,JVM内存结构是与JVM的内部存储结构相关,而Java内存模型是与多线程编程相关,本文针对这两个总是被混用的概念展开讲解。 JVM内存结构 JVM构成 说到JVM内存结构,就不会只是说内存结构的5个分区,而是会延展到整个JVM相关的问题,所以先了解下

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Google 与微软的浏览器之争

浏览器再现“神仙打架”。整理 | 屠敏头图 | CSDN 下载自东方 IC出品 | CSDN(ID:CSDNnews)从 IE 到 Chrome,再从 Chrome 到 Edge,微软与...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

85后蒋凡:28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门,他的人生底层逻辑是什么?...

蒋凡是何许人也? 2017年12月27日,在入职4年时间里,蒋凡开挂般坐上了淘宝总裁位置。 为此,时任阿里CEO张勇在任命书中力赞: 蒋凡加入阿里,始终保持创业者的冲劲,有敏锐的...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

什么时候跳槽,为什么离职,你想好了么?

都是出来打工的,多为自己着想

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

立即提问
相关内容推荐