How to write a dynamic string replacement in git bash?

This is on Windows 10 using the Linuxy environment provided with Git Bash. I have this line in my target source file: ‘version’ => ‘v1.1.023’, I have this function in my ~/.bash_profile: function tag() { …. tagname=”$1″ cmd=”s:v[0-9]\\.[0-9]\\.[0-9]+:$tagname:g;” perl -p -i -e “$cmd” config/app.php … } When I run the command: $ tag v.1.1.024 The […]

Git pull/clone branch to web server without history

My goal is to clone/pull/whatever a copy of the latest version of a branch of my repository to my test web server, to test before production. Note: I realize there are a ton of similar questions on here, but the ones I’ve looked into were different enough from my situation that I still came away […]

Getting 'fatal: empty ident name not allowed' when doing 'git commit –amend'

I am doing a git commit –amend and I get this error: fatal: empty ident name (for <>) not allowed I’ve found a bunch of stuff saying I need to set my user.email and user.name, but I have. This is the the result when I do a git config –global –list: core.exludesfile=/home/dzou/.gitignore core.editor=vim user.email=dzou@company.com user.name=dzou […]

Is the .git/ folder only supposed to be located in the project's root location?

Does git allow (i.e., is there a valid use case) a .git/ folder inside subfolders? Or is the .git/ folder supposed to be only in one place and that is in the project’s root location?

Rewrite git history to modify a file

To remove a large unwanted file from all of git history you can use filter-branch to rewrite the index (the list of files in the repo) of each commit so the file was never added. git filter-branch –index-filter “git rm –cached –ignore-unmatch path/to/offending_file.wav” –tag-name-filter cat — –all But what if I want to keep the […]

Is it possible to display a list of all changed files in all commits of a branch in Visual Studio 2017?

In Visual Studio 2017, I have a project using Git and would like to generate a list of all changed files within a branch as compared to the master branch. If a file were modified in many commits, it should be listed only once. I have no preference on how the list is output, so […]

Git repo with submodules does not track local changes?

I have a git repository with 3 submodules, like this: foo/ # main repository bar1/ # submodule1 bar2/ # submodule2 bar3/ # submodule3 I’ve added the submodules directly after executing git init in the main repository: git submodule add https://github.com/bar1.git bar1 … The strange thing now is if I add a new directory like foo/test/ […]

Sonarqube scan from Jenkins : ClassNotFoundException: org.eclipse.jgit.api.Git

I have a problem when doing a SonarQube Scan from Jenkins. See the stacktrace in debug mode : [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project scbm-order-parent: Unable to register extension org.sonarsource.scm.git.JGitBlameCommand from plugin ‘scmgit’: org/eclipse/jgit/api/Git: org.eclipse.jgit.api.Git -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project scbm-order-parent: Unable to register extension […]

advice on how to structure git repositories with common code

we have a small team (3 devs) looking to setup git repository for source control, the project is basically a product with many clients, and it changes a little for each client the code is in visual studio, there are a total of 11 projects, that includes: admin site client site mobile site API’s Utilities […]

What is the difference between diff and diff-index with these flags

I have these two git commands git diff-index –cached –name-status HEAD and git diff –cached –name-status I can’t see the difference between them. I’ve been experimenting with adding and modifying and deleting files on my branch and running these commands but they seem to be giving me the same results.

Git Baby is a git and github fan, let's start git clone.