Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [git]

Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

0
votes
1answer
13 views

get all git remote.origin.url from exisiting clones in sub directory

i like to write a oneliner which gets me all remote url from my cloned repositories underneath my git_repo folder (personal git root folder) and to pipe into a file my idea was something like cat */....
0
votes
2answers
35 views

Print all subdirectories in the current directory that do not contain a .git

I'm trying to write a bash line that will look at all the subdirectories in my current folder and tell me if any do NOT contain a ".git". Pseudo: for subdir in currentdir if .git does not exist ...
1
vote
1answer
21 views

How to properly solve “git-gui: command not found” on Arch Linux?

The Arch Linux git package installs git-gui under /usr/lib/git-core/. This means git-gui cannot be launched directly from the terminal without specifying the full path: $ git-gui bash: git-gui: ...
2
votes
1answer
51 views

Cannot su into root default shell - Debian

I am using a Debian 9 server. Usually I access via ssh to a normal user (say user1) and su into root, because I disabled ssh into root. Lately I was setting up a git-server where I created a user git ...
1
vote
0answers
24 views

Git add, commit, push from bash script

I'm trying to write a simple cron job that will keep my org-mode files in sync with a GitHub repo by committing every now and then. For some reason, it always manages to commit the files, but even ...
-1
votes
2answers
38 views

“Filename” vs “Filename-git”

What is the meaning of files that end in -git? For example, I searched in a Terminal for "xcb-imdkit" then pressed tab. xcb-imdkit comes up, as well as "xcb-imdkit-git".
1
vote
0answers
36 views

Why was every .git folder on my system modified?

I ran my semi-regular rsync backup on my personal laptop to an external drive today, and I noticed many .git/ folders had their backups updated, presumably because they were all modified. However, ...
1
vote
1answer
26 views

Define git aliases based on gitconfig in zsh

I have the following lines in my ~/.aliases: function __function_exists() { declare -f -F $1 > /dev/null return $? } # git aliases (need to have git bash completion installed) for al in `...
1
vote
1answer
24 views

Git package breaks bash-completion?

I am about to try and install the git package. In Synaptic, in the dependencies tab, it writes: Breaks: bash-completion (<1:1.9-1) Breaks: bash-completion [italicized] I have the latest version ...
1
vote
3answers
26 views

How can I eliminate untracked files from find output?

I want to find within my project directory, but I'm only looking for files that are tracked by Git. Is there a command I can use as a filter for the find output (or any other means) to limit the ...
0
votes
0answers
19 views

Why is stdin closed in Git hooks?

Based on how to prompt a user from within a Git hook it looks like stdin is closed by default within Git hooks. What is the reason for this behaviour? It's causing problems both with commands no ...
1
vote
1answer
33 views

Tmux crashing tty_clamp_area

using tmux as my dev environment. I have a standard split with vim on top, a three panes bellow that, one running npm start, one running the nodejs backend and the other one for stuff like git status. ...
0
votes
0answers
39 views

How to put secure password in Jenkins Groovy parameter script

My overall goal is to create a build parameter in Jenkins which is a drop down for only release branches. I have been at this for some time and know there are many ways to do this. Let me run through ...
1
vote
1answer
27 views

Why does executing `git status` change the result of subsequent `git diff-index`?

consider: $ git --version git version 2.20.1 (Apple Git-117) $ git diff-index --quiet HEAD ; echo $? 1 $ git status > /dev/null $ git diff-index --quiet HEAD ; echo $? 0 This is on macos with a ...
0
votes
1answer
61 views

Unable to access GitHub; Couldn't connect to server

I've been trying to clone a git repository (several, actually) and I'm getting the following error: fatal: unable to access 'https://github.com/repository-name': Couldn't connect to server My ...
1
vote
2answers
64 views

Have custom grep exclude dirs for each project

I'm curious if anyone has a way to automatically generate a different set of --exclude-dir flags for grep for each different codebase that you work in. Because in one project, I'll never want to ...
0
votes
1answer
21 views

git remove from repo history a large subdirectory that was removed several commits ago

This repository had a large subdirectory of large files that months ago I removed from the commit and that I now want to remove from the repo forever. The massive subdirectory is no longer in the ...
0
votes
1answer
64 views

Is NixOS configuration gittable?

Long story short: I've used only distributions with "imperative configuration management/packaging" approach, so far. And,... I'm annoyed by hard to trace breakages/issues with imperative ...
0
votes
3answers
29 views

trouble with two delimiters in awk

I'm trying to make a git alias that shows branch names and descriptions. There is no dedicated command or switch to get the description of a branch; it must be sussed from configuration. However I ...
0
votes
0answers
31 views

How to install git repo using apt-get?

I want to install my new git hub application to system using command like apt-get install <application_name> rather than cloning git repo and compiling and moving the file to /bin/folder.
1
vote
2answers
35 views

Capture git output into variable

If I run a command in a subshell, I can collect the stdout into a variable, such as: var=$(echo 'hello world') echo $var Will print 'hello world' as expected. If I add colour and a new line, this ...
0
votes
0answers
22 views

How to efficiently track .bashrc (and similar) with git? [duplicate]

I would like to keep my .bashrc file in a gitlab repo, for obvious reasons. However, it sits in my home directory. Initialising a git repo in my home repo seems unweildly, as it then looks at ...
0
votes
1answer
58 views

How to use zsh tab completion on Git without origin?

I am using zsh with oh-my-zsh on Ubuntu 18.04.2. Currently, Git is installed at version 2.20.1. Whenever I want to push a local branch to a remote (origin) I try to use the tab completion in the ...
0
votes
2answers
66 views

Debian 8 - Can't install Git [duplicate]

I'm trying to install Git using the following commands: sudo apt-get install git-core and sudo apt-get install git Both don't seem to work. It seems that it can't find some packages. This is the ...
1
vote
0answers
43 views

Debian 9 - sign_and_send_pubkey

I decided to start switching my machines over from Ubuntu to pure Debian but I'm currently stuck at a hurdle with configuring my git repositories related to ssh. I created a new key and added it to ...
1
vote
1answer
66 views

What to do when hard link is lost because of my text editor

So, I have a file, for this instance we shall call it $HOME/Documents/hello.txt. I will write some text inside it: Hello, welcome to my text file And I will hard-link this file here: $HOME/Documents/...
1
vote
1answer
36 views

How is the Linux git repo related to other distribution git repos (such as Ubuntu)?

I am trying to build a custom version of my Ubuntu kernel, and want to apply a patch that I see on the main Kernel tree. I know that Ubuntu development happens in these repos: git://git.launchpad....
-1
votes
1answer
68 views

Problems While Installing Git in RHEL 7.6

I am trying to install git and I get the following error though I have a valid subscription of the RHEL Client 7.6. No package git available. Error: Nothing to do I ran the following commands: [...
0
votes
0answers
27 views

when I do git diff filename, I get “g -csn: pg: command not found”

When I run : git diff filename That returns : pg -csn: pg: command not found Why am I getting this?
1
vote
1answer
66 views

Git init in wrong directory? How to recover? (theoretical situation)

This is completely theoretical, but I'm new to Git and Linux so I want to know. If I accidentally manage to do git init inside e.g Desktop or Home directory, how to prevent any possible disaster from ...
0
votes
1answer
23 views

Remove .gitignored folders and `node_modules` and `vendor` folders whilst I rsync them

On my GNU/Linux machine I want to backup a list of files specified in a text file names rsyncFolders.txt the idea is to keep the files I want and to exclude unwanted ones to backup. In these folders ...
0
votes
1answer
66 views

I deleted my files with git rm, but i also commited them, how to get them back?

I ran git rm on some files thinking that they will be removed from the bitbucket repository, and i also commited them, after that i checked that they disapeared from the bitbucket repo, but they were ...
1
vote
0answers
28 views

How can I use for example SourceTree with a remote repository?

I've a server with a folder. In this folder I've did a git init to create a git repository in this folder. When I open now a file in this folder and change something, the git notices this and mark it ...
0
votes
0answers
17 views

git hook for pre fetch

I have a notify watching a local git directory and I want to disable the notify before the fetch,merge,pull... With the notify running, the pull of files alters the directory and fires the notify. ...
-1
votes
1answer
34 views

Git fails when not run as root

I just upgraded to Git 2.18 via EPEL on CentOS 7 and now Git fails on any operations that involve communicating with a remote server with the message fatal: unable to access 'https://my.repo.git/': ...
1
vote
0answers
59 views

How do I maintain a patched version of a package for unprivileged installation?

I use some common software packages frequently enough that I found it worthwhile to modify their code a bit to work more smoothly for my peculiar needs. However, I was not able to get my changes ...
1
vote
0answers
17 views

Cannot create Git remote on FreeBsd version 6.0 using git version 1.4

I'm trying to get some code in an old server running freebsd version 6 with git version 1.4.1 on to github. I'm trying to add a remote to the repo referencing GitHub.com repo. Does anyone have or ...
2
votes
1answer
50 views

How to create upstream tarball from Git repository of Debian package

I have a Git repository with these branches: debian master pristine-tar upstream I do not have an upstream tar ball. Can I create an upstream tarball from the Git repository I have? If so, how?
-1
votes
1answer
140 views

cannot create regular file '/usr/Desktop': Permission denied

Im trying to git clone git clone cp /usr/Desktop But it comes up with cannot create regular file '/usr/Desktop': Permission denied every time
0
votes
1answer
16 views

How to build Postfix from Debian Salsa Git? (gbp:error: upstream/3.3.2 is not a valid treeish)

I would like to rebuild the Debian package 'postfix'. Without anything fancy, so no local patches and unsigned packages are fine. Here's what I tried: Install some dependencies: $ apt install ...
-1
votes
1answer
112 views

How to clone multiple repositories from different project using shell script?

I had an url for multiple projects inside i have multiple repos for each project I need to clone all the repos in a directory and find git branches. i tried this #!/bin/bash project=(aa bb cc) aa=(...
0
votes
0answers
18 views

Error in git install from source on Ubuntu

I get the error message install: missing destination file operand after 'git' I tried to install git but whenever I tried I get git clone https://github.com/lwfinger/rtlwifi_new.git Command 'git' ...
0
votes
1answer
43 views

git pre-commit script

The goal is to exit from the script with a non-zero exit code when committing package-lock.json with no associated changes to package.json being committed. #!/bin/bash # exits with 1 if there were ...
0
votes
1answer
51 views

unable to execute git pull if the script is executed on reboot

I have created the following script: #!/bin/bash cd /home/pi/workspace/my-app /usr/bin/git pull python3 main.py & If I run the script from the console, git pull is executed as expected and then ...
0
votes
2answers
262 views

Check via shell-script if git repository's master branch is behind origin

I'm currently writing a bash script to remind me to rebase git repos when the local master branch is found to be behind origin/master. So far I have come up with the following, but $? always returns ...
0
votes
2answers
81 views

Cannot compile git on OpenBSD

I'm trying to install git on a college server, just for my user, but for some reason I can't compile it. I tried the latest version on github, as well as a couple random older versions from both ...
1
vote
2answers
25 views

How to show latest release's Git tag with message

Was creating a script to update a Github application in-place and needed to print changes made in the latest Git tagged release so users could make an informed decision about pulling the trigger on ...
4
votes
2answers
128 views

secure read-only self hosted git repository for scripts

I need to build a git server where certain users have a read-write access to the repository and management server running certain scripts using this repository has the read only access to the same ...
-1
votes
1answer
53 views

Creating a Shell Script that deletes specified files in git repo

How would I create a script that would take a list of file names in a git repository (I was planning on using a .txt file with one file name on each line, but I am open to other suggestions) as an ...
0
votes
3answers
61 views

Alias for git command

is there a way to make an alias for creating, a new branch? For example, I want to type "feat" and get something like "feature/blabla-" so I will need to add just a number. i want to type git ...