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.

Filter by
Sorted by
Tagged with
0
votes
2answers
37 views

SSH keys that can be used only in one machine

My requirement is simple. I have generated a SSH key-pair (Public and Private) on a server say "A". Now I have uploaded my Public SSH key in AWS IAM and have generated a SSH key ID to connect to a ...
0
votes
1answer
27 views

How can I search terminal output?

Say I type git help to learn about the merge command. I don't want to read all the output just the lines that contain merge and their surrounding lines. I thought this would be a common question but ...
1
vote
1answer
19 views

Can I safely git/commit/push or rsync a file being currently written by tee without breaking any pipe?

I have a pipe working for several days and writing some scientific results at a very low rate (a block of about 20 lines once an hour); most of the time, nothing is written. The file is written by tee....
1
vote
0answers
41 views

git ssh to ipv6 address on non-standard port

I am trying to access a git respository at a IPv6 address that has a SSH server listening on port 1111(for example). Access is controlled by SSH key and I can open a SSH session on the gitserver ...
3
votes
1answer
52 views

Comparing exit code: unary operator expected [duplicate]

I have a list of git commits in a .txt file and I want to iterate over the commits. For each COMMIT_ID I want check them using a git command whose exit code is 0 or 1. Depending on the result I want ...
0
votes
0answers
31 views

Why does git clone prompt for 'passphrase for key' when I SSH to my machine as my user?

I am running Ubuntu 16.04. When I am logged in normally and I run a git clone it works without issues - wesley@localhost:~/Temp$ git clone ssh://git@xyz.pqr.com:5678/abc/myproject.git Cloning into '...
1
vote
2answers
60 views

backup - can I use git to backup /etc? [duplicate]

I am using mac, and /etc is just a symlink to /private/etc, which contains hundreds of (important) configuration files, and the total size of /private/etc directory is smaller than 1 MB. Is it a good ...
0
votes
1answer
23 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
42 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
30 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
55 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
52 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
43 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
36 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
25 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
32 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
21 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
53 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
108 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
31 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
91 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
67 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
28 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
82 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
30 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
33 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
43 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
23 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
77 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
72 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
59 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
74 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
37 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
101 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
82 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
24 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
84 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
29 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
19 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
38 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
61 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
18 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
59 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
161 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
20 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
148 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
20 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
48 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 ...