All Questions
3,762
questions
0
votes
0
answers
38
views
Shell script to add and commit in batch of files at a time [closed]
I will like to fix the issue where "git add" fails when a space is detected in the path file name. e.g source/code/data form/documents.txt. How can I update this script to allow file names ...
0
votes
0
answers
25
views
Bulk add both modified or deleted files separately to index in git
I've normally used git add . which is sufficient most of the time.
But sometime I would like to separately commit deleted or both modified files after manual conflict resolution.
Though git add $file ...
1
vote
1
answer
59
views
How to take full advantage of Git Bash completion for a passthrough command that takes its own args?
I have created a custom Git command called git-profile. It uses the git-<command> naming convention to enable use as compword in Git Bash completion. implemented as a Bash script, that accepts a ...
-1
votes
1
answer
47
views
Search string only in added or removed lines using git pickaxe
I can search a string in changes with git log -S "text to find" --stat. How can I do a similar search, except look for the string in only added or removed lines (not both)?
There is a --diff-...
-1
votes
1
answer
42
views
git pre-commit hook does not open commit_template based on GIT_EDITOR value
I am developing a functionality for more automatic Git commits. We are using a pre-commit hook, and the idea of the hook is to request a task ID and summary, then write them to the commit template. We ...
0
votes
0
answers
34
views
How to clone or download locally a Replit repo from bash?
How can I clone or download locally a Replit repository from bash or CLI?
I tried:
git clone https://replit.com/@USER/REPO
Also I tried:
wget https://replit.com/@USER/REPO.zip
But for this second ...
0
votes
1
answer
55
views
How I can also push the commit generated in my husky pre-push hook script?
In my husky pre-push hook, I bump the version in package.json by a user's choice:
#
# Copyright 2024 Cypriot Free Software Foundation
#
# Permission is hereby granted, free of charge,
# to any ...
0
votes
2
answers
40
views
How to append a pattern to each list member from back quote output?
For example if I do git diff --name-only under a git local directory, the command returns the list of files seen from the git root directory like this.
ab21/ab21_universe.sv
ab21cv/apzeus/aarch64/...
0
votes
0
answers
21
views
Hook fail when creating a new branch in GitLab
we have a self-managed gitlab install with a very simple git pre-receive hook to check the commit message format:
#!/bin/bash
while read oldrev newrev refname; do
if [ "$oldrev" -eq 0 ]; ...
0
votes
2
answers
77
views
How to change path to the current directory in bash
I'm trying to customize my bash prompt and here's what looks perfect for me:
PS1='\n\[\033[32m\]\h \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n'
I want the current path to start only from ...
1
vote
2
answers
91
views
Cannot use command substitution inside Git Bash on Windows: "bash: command substitution: line 1: syntax error near unexpected token `)'" [duplicate]
In a Bash terminal on Linux, this works fine:
# define some bash func
foo() {
echo "foo"
}
# Back up your system's default PS1 prompt 1 string, which controls the prompt
# output
if [ -...
2
votes
2
answers
63
views
how to capture filename along with space in bash when operating with git diff
Team,
my use case is we don't want any user to push a file that has leading/trailing space in it. as it blocks windows local users
I have this code but seems like files_in_change=$(git diff HEAD~1 --...
0
votes
0
answers
39
views
Merging Multiple repo's into a seperate repo
I have to merge 130 different repos into a seperate one and make it so all of the other repos have a folder under the new repo where I want to merge them to.
Hi, I have the following code to merge a ...
1
vote
1
answer
50
views
Inconsistent git log results when filtering by directory
I’m encountering an odd behavior with git log when filtering by a specific directory. Here’s the command I’m using:
18:05:04 ~/Documents/01_repo/b2b-crm (uat)
└─▶ $ git log --name-status --oneline --...
1
vote
0
answers
58
views
How to pull from a remote repo to a local repo, when the local repo is not empty?
I have a remote server, with a directory containing files. I have a local machine with a directory containing different files. I want to link these two directories so I can run git pull and git push ...