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

learn more… | top users | synonyms

5
votes
3answers
5k views

Tar a folder without .git files?

If I tar a folder that is a git repository, can I do so without including the .git related files? If not, how would I go about doing that via a command?
3
votes
1answer
52 views

How to create an alias for two Git commands that use a parameter? [duplicate]

I regularly have to delete a local and remote Git branch. Therefore, I run the following commands: $ git branch -d feature-branch $ git push --delete origin feature-branch Since I mostly execute ...
1
vote
0answers
33 views

Build CentOS RPM for current git release, unsuccessful rebuild with alternate prefix

I am stuck in an effort to provide an maintain an up-to-date git release for a collection of CentOS Linux servers. I was hoping to be able to create binary RPMs that I could just have published to a ...
1
vote
2answers
22 views

Forward ssh for git user to git server

It is surprisingly difficult to find information on this simple problem. Like many people we run a gitlabs/gogs server on a remote instance. Currently it listens on port 10022. We also run ssh on ...
1
vote
0answers
28 views

How to install the latest version of Git on Ubuntu? [duplicate]

I have version 2.5 of Git on Ubuntu: $ git --version git version 2.5.0 but Git is at version 2.7.1 now. The Git website says to do apt-get install git to install it. But I tried both sudo ...
2
votes
2answers
1k views

SSH Agent Forwarding on server

I'm struggling with the concept of SSH Agent Forwarding. This is what I've done so far: Create default identity local (ssh-keygen) Install the public key on bitbucket Now I want to connect to a ...
0
votes
1answer
26 views

How do I get git to give me an acceptable pkgver for Atom which I can use to check it out?

I am working on the atom-editor-git PKGBUILD in the AUR, hoping to turn it into an Atom equivalent to the gvim-git PKGBUILD. See the gvim-git PKGBUILD updates its package version whenever it is run to ...
1
vote
0answers
12 views

size of array '__curl_rule_01__' is negative [migrated]

I'm struggling with an error whilst trying to compile GIT. I've searched Google and the GIT source issues/bugs for similar issues but i've not found anything to help me. Originally I received the ...
15
votes
5answers
13k views

Is there a usable gui front-end to git on Linux?

I'm a former windows user and just started using ubuntu. On windows, we had two great softwares: TortoiseSVN and TortoiseGit. Both are so good programs that they allow us to do everything like commit, ...
1
vote
1answer
20 views

Merging text file directories

I have two directories: Libc-825 and Libc-1044. Imagine that version 1044 is newer, but buggy. Is there a way to merge these file trees? I have there C sources with not so big differences. I have ...
0
votes
0answers
32 views

Git “unknown revision” error when within bash script

I'm writing a shell script that needs to perform certain operations based on the last commit's message of my local branches with a name starting with "task". Here's what my script looks like ...
65
votes
6answers
93k views

GUI for GIT similar to SourceTree

Is there a similar piece of software to SourceTree, a GUI for git, for Linux? I know about Giggle, git cola, etc. I'm looking for a beautiful, easy to use GUI for git.
0
votes
2answers
28 views

Patching diff-files

I've downloaded a tarballed version of 0.85 "MTR" -> http://www.bitwizard.nl/mtr/ and installed it. I later saw that a 0.86 diff file exists. I downloaded this in order to patch it, but am confused ...
12
votes
3answers
2k views

Can git configuration be set across multiple repositories?

Git seems to support configuration values at three levels: Per-system global settings (stored in /etc/git-core) Per-user global settings (stored in ~/.gitconfig) Per-repository local settings ...
5
votes
1answer
3k views

How to create a git repo using Nginx?

I've a CentOS 5 server at domain.fr. I am trying to set a subdomain so that I can use it with git : git.domain.fr My repositories are in /home/git (example /home/git/repos.git) I've installed ...
0
votes
0answers
7 views

How do I clone the git repository of an individual Arch Linux package's source files? [duplicate]

I would like to clone this repo for VirtualBox, so that I can bump it to version 5.0.14 locally and update VirtualBox on my Arch machine using it. I know I can clone community.git from ...
0
votes
1answer
30 views

Can someone please explain this error I'm getting in my script

I'm trying to create a script which I can set as a cron job which adds all my dotfiles to a folder I've set up as a github repo then push them every evening. My script is the following. cp ...
2
votes
2answers
3k views

Git pull error libcurl.so.3 not found

I have a php script to git pull from my github repository set up in my webservice hook urls like so: <?php echo shell_exec('~/git/usr/bin/git pull 2>&1'); ?> When I open this script ...
8
votes
3answers
3k views

command line method or programmatically add ssh key to github.com user account

Is there a way to identify with a username and password to github.com servers for the purpose of adding an ssh key to the github user account? So far everything I've read suggests that a user's ssh ...
1
vote
1answer
31 views

Estimate time spent on Git project with grep

Consider a Git log: commit 4d6b30238fbfc972ea4505cadf43abd316506d9e Author: Dotan Cohen <dotancohen@foobar.com> Date: Mon Jan 11 22:41:21 2016 +0200 Final foobar version commit ...
2
votes
1answer
730 views

sudo -u git clone

I'm on Ubuntu server 14.04. I am using apache web server which runs as the www-data. I need to do git clone from a script (a web hook). This script will run with www-data user privilages. Running ...
1
vote
0answers
235 views

Run git pull from a shell start-up script

I have Raspberry Pi that loads a shell script on start up. This script runs a python script, boot_camera.py, which is found in a repository. I Have a server which sends the Raspberry Pi a command ...
1
vote
1answer
53 views

Updating a git variable in the Shell prompt on every command

I am running TCSH and I would like to update my prompt every time I run a command. I think can currently do that via backticks. set tmpstr = `git status --untracked-files=no --porcelain` set ...
1
vote
0answers
50 views

customized pager for Git

I wrote a script to display git diff. It will display the difference in stdout if the output fits in the terminal screen, or display the difference in pager otherwise. My script: #!/bin/sh if ! ...
2
votes
1answer
21 views

Find all git repos that do not contain any one of .gitignore and .gitattributes

I basically want to find all git repos that have neither a .gitattributes nor a .gitignore file at the root. I used find . -type d '!' -exec test -e "{}/.gitignore" ';' -print to find it but it lists ...
3
votes
1answer
16 views

command-click git commit ID in Terminal, and be taken to that commit in github?

I'm running a Mac and use iTerm with ZSH as my shell. Currently I can command-click (⌘+click) on links or directories in my iTerm window, and that directory or web link will open. Is there a way ...
1
vote
2answers
29 views

how to edit author details for gitg?

I just recently installed gitg and whenever I tried to make a commit, I encountered an error of missing author details. However, I am unable to change author details as no editing window pops up after ...
1
vote
3answers
78 views

How to install latest git on Debian 8?

I have some problems with git-lfs and I think that upgrading to the latest git can fix this problems. Current version of git in Debian is 2.1.4, current stable version on official site is 2.6.4. Can I ...
0
votes
1answer
26 views

Should file expansion happen before a command sees its argument?

In Bash, given a command which takes a pathname as an argument, does file expansion happen to the pathname argument before the command can see the value of this argument? My question comes from my ...
0
votes
0answers
25 views

DNS problem with ipv6 on centos6

I have a couple of open-stack instances that communicates with github.com. When any of these machines reboots , the file /etc/resolv.conf gets the ipv6 addresses of my DNS servers. Everything still ...
0
votes
0answers
17 views

Git-cherry not ignoring whitespace as advertised

Given the following two versions of the foobar.txt file (excluding comments) ... ... on the upstream branch (version 1, commit 1): foo bar ... on the downstream branch (version 2, commit 2): # ...
1
vote
1answer
15 views

Is it always necessary to run etckeeper git commands using the vcs command?

I've seen some tutorials on the internet in which people are using etckeeper to keep a log of their server configuration, and yet they use the git command directly instead of running it through the ...
1
vote
0answers
10 views

Using gitk to view changesets in a linux server using etckeeper?

gitk is a pretty good tool for viewing changesets in a git repository. Is there any way to use it locally on my workstation to view/review an etckeeper git repository on a remote server? Also ...
2
votes
2answers
23 views

How do I filter a list of files for text only files?

I wanted to have a git openlast command which would look at the last commit, get a list of added or changed files, filter them to only the text files, and finally open them in an editor. So far I've ...
3
votes
3answers
58 views

Git Bash - ls show repo folders

If i have a folder, Tools, so I pwd > /c/Tools in tools I have three folders (solution folders for Visual Studio but not important). I want a command like below 1234@Computer mINGW64 ~/Tools $ ...
1
vote
2answers
57 views

How do I reset a git branch to a given previous commit and fix the detached HEAD?

I needed to reset my branch to an earlier working state (commit) so I did: git reset --hard c70e611 Now I see HEAD detached at c70e611 nothing to commit, working directory clean How to fix / ...
1
vote
0answers
52 views

Bash - Parameters Reference passing (sort of)

So, I've figured out thus far how to utilize the "local -n " command, which effectively allows me to "reference pass" a variable from one function to another. this is rather helpful when parsing out ...
1
vote
1answer
34 views

Customize Git Bash Color

I used to have a black / orange / green git bash color style. Now I needed to download it again and it's a mess (for me). All pink, lime green and yellow. It hurts my eyes. Is there a way to ...
0
votes
2answers
698 views

Ignore files when building debian package

When I build myproject with the command: dpkg-deb -z8 -Zgzip --build myproject It packs all files inside the package. Is there a way to ignore some folders from being packed inside the deb-file? ...
0
votes
4answers
80 views

Colorize filenames based on status for git diff --name-status

I often use git diff --name-status BRANCH_NAME to get the list of modified files. Is it possible to colorize the output of that command similar to the output of git status - green for added files, ...
1
vote
1answer
8 views

List files added and removed between tagged releases

Given two tagged releases in a Git repo, is it possible to list the files that were either added or removed? For example, suppose tagged release 1.0 has a number of header and implementation files. ...
1
vote
0answers
17 views

How to make patch not so strict?

To give you the background, I'm trying to "port" "commit only parts of hunks" workflow from git to svn. In git there is interactive staging, and you can even edit hunks to be committed (chose which ...
1
vote
1answer
584 views

How to fix “Hunk #1 FAILED at 1 (different line endings)” message?

I am trying to create a patch with the command git diff sourcefile >/var/lib/laymab/overlay/category/ebuild/files/thepatch.patch when I apply the patch, it gives me $ patch -v GNU patch 2.7.5 ...
0
votes
1answer
34 views

Error setting certificate while doing 'git clone' in redhat

Error: % git clone --depth 1 http://github.com/junegunn/fzf.git ~/Downloads/fzf Initialized empty Git repository in ~/Downloads/fzf/.git/ error: error setting certificate verify locations: CAfile: ...
3
votes
2answers
89 views

Can users in a group access a file that is in another user's home directory?

I have 3 users A,B and C inside a group 'admin'. I have another user 'D' in whose home directory, there is a project folder. I have made D as the owner of that folder and assigned 'admin' as the group ...
11
votes
2answers
111k views

Installing git “sudo: apt-get: command not found”

I am trying to install git. I run the following command: sudo apt-get install git-core git-gui git-doc But receive the following error: sudo: apt-get: command not found What should I do?
1
vote
2answers
71 views

Pipe filelist into 'git add'

I performed a fresh clone and copied/pasted a working directory into the cloned directory. Now have a list of changed files: $ git status --short | grep -v "??" | cut -d " " -f 3 GNUmakefile ...
1
vote
3answers
67 views

Debian - Disable console access for specific user

I have a server with a git server running on it. I would like git users to be able to clone, push and pull using their linux username and password, but not to be able to login to linux console. If I ...
19
votes
2answers
9k views

How to use rsync to backup a directory without git subdirectory

I want to copy my c directory with all subdirectories excluding ./git subdirectory. I do it using rsync : echo "copy c and sh files " rsync -a --include='*.c' --include='*.sh' --include='*/' ...
1
vote
1answer
43 views

Busybox pager with color capability?

I asked on Superuser about colors for git log in MobaXterm (on Windows), but it turned out that the problem wasn't MobaXterm—it's the lack of a -R flag in busybox's less. It would help my workflow ...