Stack Exchange Network

Stack Exchange network consists of 174 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
2answers
46 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 ...
0
votes
1answer
17 views

use 'diff-highlight' for diff

I have set up diff-highlight as pager / highlighter for git. [pager] log = diff-highlight | less show = diff-highlight | less diff = diff-highlight | less That works perfectly. But how ...
-1
votes
1answer
20 views

Git Server Binding Directory To Port

I have a git server i have stood up. It is a basic one with all the remote repositories stored under /mygit/repo/ I can push and pull and all the other git stuff using this ssh syntax ssh:/...
1
vote
2answers
38 views

How to add ~/.zshrc file into git?

I would like to create a backup of the .zshrc file in my ~/ directory and avoid versioning all other items. How to exclude all subdirectories and their content? For example: cd ~/subdirectory/ &&...
1
vote
1answer
48 views

Protocol SSL is not working with Curl

I am trying to clone Wayland repository from git (for a project) but git clone command is throwing me an error. I installed curl (from here). After cloning make && make install. Earlier I had ...
0
votes
0answers
65 views

Yet another `sign_and_send_pubkey: signing failed: agent refused operation`

Here’s a Yet Another Question about the clash between ssh and gnome-keyring-daemon, since after spending hours and hours on the Internet I finally gave up. Environment OS: openSUSE 15.0 DE: XFCE ...
1
vote
1answer
19 views

Understanding environment variable / shell syntax

I was just following the install instructions for zsh-autosuggestions and I don't understand what part of the following command is doing: git clone https://github.com/zsh-users/zsh-autosuggestions ${...
2
votes
1answer
132 views

How to generate (git) diffs with <n> characters of context?

The --unified=<n> option lets you set the number of lines; is there a way to do the same for characters? example limit the context around the changes to X character(s) when using git diff --...
0
votes
3answers
192 views

What is the difference between apt, apt-get and git?

I use Xubuntu and found that I can update packages by using apt and apt-get. But I have heard that programmers use usually git in their project to manage different version. So why Xubuntu do not use ...
0
votes
0answers
23 views

google-cloud-print-connector - SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

I have an ancient CentOS 5.11 installation on an inhouse server. The server is due for upgrade in a few months but till then, I'm stuck with 5.11. I intend to install google-cloud-print-connector but ...
2
votes
1answer
42 views

Tool for searching across branches and through history in a Git repository

I'm looking for a tool, or for suggestions towards a script, that would be able to search a Git repository for files based on both filenames and file contents (find/grep-like). It would need to be ...
0
votes
1answer
57 views

gpg: signing failed: Operation cancelled under tmux?

I have found a strange error. It is OK when I commit using gpg with git under bash or zsh. git commit -S -m "xxx" However when I commit it under tmux, I got: gpg: signing failed: Operation ...
0
votes
1answer
34 views

Does the devtools package include git?

In the Arch Linux standard packages, does devtools include git or do I need to install git separately? How can I figure out the answer to similar questions on my own?
0
votes
0answers
28 views

How to trace a specific historic file in the Linux kernel tree: Git question

I'm currently manually building a Linux image with some specific drivers for a Xilinx Zynqmp device. Aside from the main Linux tree, there are 2 other mirrored Linux repositories, one from Xilinx and ...
1
vote
2answers
54 views

How can I get the Linux terminal to look like Windows Git Bash?

Before anyone says it, yes, I know this is a duplicate, except when I copy/paste that code into tilde slash period bash(no period)rc, the terminal hasn't changed at all. I'm running Debian on Virtual ...
2
votes
3answers
57 views

Block git user from login, but allow the user to still function as a git repo?

I have setup a git server, by creating a user "git" and then creating a local repository in the git user's directory. The git server works great, I can pull, push, etc. I allowed users to interact ...
1
vote
1answer
29 views

Outputting if the last command was a successful git checkout

I am trying to echo to the console in the event that a successful git checkout happened, but cannot get it to work. function prompt_command { prev=`fc -ln -1` ecode=$? if [ ecode = 0 ] ...
0
votes
2answers
34 views

Git: autocomplete my prompt after failed push because missing -u flag

Using git, I often create local branches and then want to push them to the remote (e.g. Github). This requires the -u or --set-upstream flag. Here is what git outputs without this flag: $ git ...
0
votes
1answer
43 views

Git: change content of previous commit and push [closed]

I'm reviewing a repo and I'd like to make some comments, it would add more content like adding comments, make some changes ..etc. How to change content of files of previous commit and do push, I'm ...
3
votes
0answers
18 views

git return filtered repo to original parent

I want to reverse a git filter-branch and want to know the best way to do this. Originally I had a repo like this : A p q r I then made q its own repo so that I had this: A p r Q Now,...
11
votes
2answers
1k views

Git: edit previous commits' messages only

For lazy reasons I pushed a bunch of commits with default messages and now it has become cumbersome, as I don't really know what I've changed in each commit. How do I edit just the messages of ...
0
votes
0answers
61 views

Git: exclude folder but include subfolder

I read this link: https://stackoverflow.com/questions/5533050/gitignore-exclude-folder-but-include-specific-subfolder/5534865#5534865 But this is use-case when git fails without any clue: * !abc abc/...
0
votes
0answers
44 views

Git: doesn't add filename with dash

lastest git versin on archlinux that doesn't add filename that contain dash, e.g: test-abc (git version 2.19.2) How to automatically add filename with dash (or folder) with git?
0
votes
2answers
17 views

Git: keep color of git stash list --pretty=<..> through a pipe

I have this command: git stash list --pretty="%C(yellow)%h %>(14)%Cgreen%cr %C(blue)%gs" gives output colored, but if I pipe it git stash list <..> | less -R, color disappear in output. ...
0
votes
3answers
150 views

Read lines into array, one element per line using bash

I am trying to get a bash array of all the unstaged modifications of files in a directory (using Git). The following code works to print out all the modified files in a directory: git -C $dir/.. ...
0
votes
1answer
40 views

git cmd formatting a log

I have a uni assignment to discuss the relationships in defective files for a given git repository. I am trying to generate a git log of the following format: file name + number of commits + current ...
2
votes
0answers
25 views

How do I upstream a patch into the Linux kernel developed by someone else?

I've recently been trying to upstream part of the Nintendo Switch-on-Linux patchset, but it appears that the original developer must sign off on each commit. Do I need to ask the original developers ...
-2
votes
1answer
152 views

Quotes don't work anymore with: git commit -m “My commit message” [closed]

I am not sure what is going wrong (terminal, shell, system?), but when I enter: git commit -m "My commit message" this morning, I get: error: pathspec 'My' did not match any file(s) known to git ...
1
vote
1answer
58 views

Using git interactive rebase from within a bash script

I'd like to create a bash script to automate a sequence of Git actions I do very frequently to apply my unstaged changes to an earlier commit, as in: Stash changes; Enter interactive rebase; Edit the ...
0
votes
1answer
63 views

How to print only git message/title using bash script?

I can print the current git commit sha1 in bash using this command: git rev-parse --short HEAD But how can I print only the latest commit message/title of the HEAD?
4
votes
0answers
102 views

Is there a standard text mode tool to render heatmaps for arbitrary numeric matrix data?

For the curiosity's sake I created a script to visualize Git history week/hour-of-day basis timestamps in order to collect some stats. The following script #!/bin/bash # Declare the global heatmap ...
0
votes
0answers
28 views

Colorize bash output?

I keep all my git repositories in a single folder, and sometimes I want to get a quick status check on all of them, mostly to make sure I'm not leaving the office without pushing any commits. I ...
0
votes
1answer
103 views

gpg2 and git signing

I have a problem with gpg2 and signing my commits in git. I should preface all this by saying this all worked yesterday before I did an apt-get update && apt-get upgrade and a reboot. Now ...
2
votes
1answer
45 views

Stripping a git repo of all committed files that should have been ignored

I recently initiated a git repo and forgot to add a .gitignore file. After my initial commit, my repo has many subdirectories and many files that should have been ignored. Is there an efficient way to ...
0
votes
1answer
47 views

Deleting a particular branch of a in bitbucket repo using API (Shell script)

I want to delete a particular branch in a repo with help of api using shell script i have gone through official document https://docs.atlassian.com/bitbucket-server/rest/4.14.4/bitbucket-branch-rest....
1
vote
2answers
58 views

git grep output is buffered. Why?

I run git grep for the first time on a large tree (the Linux kernel). This takes a long time to run. If I cancel with ctrl+C before it finishes, often it immediately shows a line it found. Why did ...
0
votes
0answers
32 views

how does ~/git-credentials file look like?

Let's say I have a git repository for e.g. - https://salsa.debian.org/shirishag75-guest/gradle-build-script- Now in my system I have - :~/games/gradle-build-script-/.git$ cat config [core] ...
2
votes
1answer
72 views

How to start Vim in insert mode at end of first line when committing Git changes?

What would be the best way to set Vim up to always put the cursor in insert mode at the end of the first line (to account for commit message templates) when running git commit? This would basically do ...
1
vote
1answer
26 views

Proxy address is being replaced with /dev/cdrom

I have a weird issue that I can't seem to find an answer for. When I enter: git config --global http.proxy http://{username}:{password}@{proxy address}:{port}/ It returns an error: git config --...
1
vote
3answers
86 views

How much space is available?

The question says Remove the entire git directory (it is not used in our tutorials). Now repeat the above calculation for disk space, but this time give the answer in blocks. I successfully deleted ...
0
votes
1answer
33 views

git: URL format to access remotely local git server

I tried links in this article, seem doesn't work for me: https://stackoverflow.com/questions/31801271/what-are-the-supported-git-url-formats Problem that I have setup a local git server at /srv/repo/ ...
1
vote
1answer
20 views

git in a local repository: get file of older version without changing repository

I'm working in a local repository. I do not want to change anything in the repository, just retrieve an older version Once I located the hash of a previous checkpoint, how can I get the file, how it ...
1
vote
1answer
39 views

bashrc function, git commit -m with spaces

Currently I have this and it works as expected if I use it like addcommit 'test commit' but if I use it as addcommit test commit it only sees the first word test. Ideally I'd like to have the ...
-1
votes
1answer
276 views

Using bash, resolve absolute path to relative path

Say I have this simple bash script: #!/usr/bin/env bash file="$1"; if [ -z "$file" ]; then echo "Must pass relative file path as the first argument."; fi git_root=`git rev-parse --show-...
0
votes
1answer
30 views

Allow automated script to incorporate git rebase

I have this in a script: set -e; base="remotes/origin/dev"; git checkout --no-track -b "$new_branch"; git rebase "$base"; on occasion, there are conflicts of course, and what happens is that git ...
0
votes
1answer
144 views

Unable to connect to angband Debian repo

I tried the following: $ git clone git://anonscm.debian.org/collab-maint/angband.git Cloning into 'angband'... fatal: unable to connect to anonscm.debian.org: anonscm.debian.org[0: 194.177.211.202]: ...
1
vote
2answers
225 views

Changing the color of git branch output?

In my .bash_profile I have a parse_git_branch function from the internet, and a PS1 to color some of my output. If possible, I would like to make my git branch name colored red, instead of white. ...
-1
votes
1answer
20 views

how to rename a remote repo name so that it makes sense to you while git cloning [duplicate]

Usually the way I do renames to make sense for myself is - $ git clone <remote URL.git> $ mv remotedir nameIwant I was wondering if there is a better way to do it. The reason is sometimes ...
2
votes
2answers
105 views

How can I use “source-highlight” with “git show”?

Using source-highlight in conjunction with less works really well, but I'm struggling to see how I can use it with git show because there's no file extension to clue source-highlight about the ...
0
votes
0answers
41 views

How to delete a git repo with submodule from NTFS partition and then git clone it with submodule initialized?

I tried setting my 2 TB hard drive partition into a NTFS file system, per an answer to an earlier question of mine. I moved a heap of my git repos onto it. Some of my repos have submodules, and ...