The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
77
votes
8answers
7k views

Tips for putting ~ under source control

I want to put my home directory (~) under source control (git, in this case), as I have many setting files (.gitconfig, .gitignore, .emacs, etc.) in there I would like to carry across machines, and ...
30
votes
9answers
7k views

How to keep track of changes in /etc/

I would like to keep track of changes in /etc/ Basically I'd like to know if a file was changed, by yum update or by a user and roll it back if I don't like the chage. I thought of using a VCS like ...
156
votes
5answers
195k views

How can I update to a newer version of Git using apt-get?

I've just set up a new machine with Ubuntu Oneiric 11.10 and then run apt-get update apt-get upgrade apt-get install git Now if I run git --version it tells me I have git version 1.7.5.4 but on my ...
22
votes
4answers
10k views

Given a git commit hash, how to find out which kernel release contains it?

Assume I have some issue that was fixed by a recent patch to the official Linux git repository. I have a work around, but I’d like to undo it when a release happens that contains my the fix. I know ...
7
votes
3answers
5k views

Shortest way to download from GitHub

This is, how I download various master branches from GitHub, and I aim to have a prettier script (and maybe more reliable?). wget -P ~/ https://github.com/user/repository/archive/master.zip unzip ~/...
256
votes
9answers
156k views

How to colorize output of git?

Is there a way to color output for git (or any command)? Consider: baller@Laptop:~/rails/spunky-monkey$ git status # On branch new-message-types # Changes not staged for commit: # (use "git add &...
29
votes
6answers
16k views

How can I create an alias for a git [action] command (which includes spaces)?

Most of my my aliases are of this form: alias p='pwd' I want to alias git commit so that it does git commit -v But trying to create an alias with a space gives an error: $ alias 'git commit'='git ...
0
votes
2answers
579 views

How can I view diffs or at least older versions of specific files with etckeeper?

So I'm using etckeeper on my machine running Debian 9.1 with KDE and would like to view diffs (or if that isn't yet implemented: past versions) of specific files. How can I do that?
11
votes
2answers
4k views

Using git to manage /etc?

I am thinking on a system, where /etc were tracked on a remote git repository. I am thinking on a git workflow, where every host machine where a different branch. Every previous versions on every ...
12
votes
7answers
4k views

How do I encrypt git on my server?

Heres the closest I've gotten: I installed gitolite in the /Private folder using ecryptfs-utils (sudo apt-get install ecryptfs-utils adduser git ecryptfs-setup-private then the rest was configuring ...
6
votes
2answers
11k 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 ...
4
votes
3answers
23k views

I am failing to clone a git repo when behind a proxy

When I run git clone git://git.gnome.org/tracker, I get: Cloning into tracker... git.gnome.org[0: 209.132.180.173]: errno=Connection refused fatal: unable to connect a socket (Connection refused) ...
3
votes
1answer
4k views

Elegant Way To Store Dotfiles on GitHub

I need an elegant solution to store my dotfiles on GitHub for easy access. I tried to create a dotfiles directory and symlink all the dotfiles into there. Then I tried adding the symlinks to git and ...
3
votes
1answer
3k 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 ...
3
votes
2answers
2k views

How to backup files in multiple directories with git?

The example below is simplified to show the core of the problem, not the problem itself(my file tree is more complicated than that). Let's say that I have two files I want to back up; one in ~/...
0
votes
0answers
141 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/...
38
votes
8answers
8k views

Are there pitfalls to putting $HOME in git instead of symlinking dotfiles?

I have for many years had my entire $HOME directory checked into subversion. This has included all my dotfiles and application profiles, many scripts, tools and hacks, my preferred basic home ...
13
votes
2answers
6k views

What does “--” mean in Linux/Unix command line? [duplicate]

Possible Duplicate: What does “--” (double-dash) mean? git diff [options] [<commit>] [--] [<path>…] In here, how should I understand what [--] means? And when should I use it.
29
votes
3answers
2k views

How did the Linux Kernel project track bugs in the Early Days?

We all know that Linus Torvalds created Git because of issues with Bitkeeper. What is not known (at least to me) is, how were issues/tickets/bugs tracked up until then? I tried but didn't get anything ...
18
votes
4answers
13k views

How do I get a linux kernel patch set from the mailing list?

I don't subscribe to the linux-kernel mailing list, but I want to get a set of patches that were posted a few weeks ago and apply them to my kernel for testing. I'm very familiar with patching, ...
17
votes
5answers
11k views

How to modify a PKGBUILD which uses git sources to pull only a shallow clone?

The other day I tried installing opencv-git from the AUR with makepkg on Arch Linux. Of course it pulls from the git repository as the name indicates. This pulls 1Gb. I am reading about making a ...
7
votes
3answers
11k views

Installing Git, Curl, and Expat from Source

I have a RHEL 6.4 VM provisioned by my company's internal KVM. We are having some trouble using yum (Cannot retrieve repository metadata, which I've confirmed in this case is peculiar to my company's ...
13
votes
1answer
3k views

watch command not showing colors for 'git status'

I'm trying to get watch to display colors from 'git status'. I've tried running watch with the --color option, as suggested elsewhere here, but, still, watch --color 'git status' doesn't display ...
15
votes
2answers
1k views

Have tree hide gitignored files

Is there a way to make tree not show files that are ignored in .gitignore?
15
votes
1answer
3k views

Excluding files in etckeeper with .gitignore doesn't work

I use etckeeper for changes in my configfiles (on Debian squeeze) Since I also have an ircdeamon running, there are some files, that change every minute in the folder /etc/hybserv/ I don't want to ...
12
votes
5answers
17k 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 ...
9
votes
3answers
3k views

How do I set Zsh autocompletion rules for second argument (of function) to an existing command's rules?

I have a custom Zsh function g: function g() { # Handle arguments [...] } Within it, I handle short arguments that execute Git commands. For example: g ls # Executes git ls-files ... g g # ...
8
votes
5answers
4k views

How to find all git repositories within given folders (fast)

Naive approach is find dir1 dir2 dir3 -type d -name .git | xargs -I {} dirname {} , but it's too slow for me, because I have a lot deep folder structures inside git repositories (at least I think that ...
3
votes
1answer
1k views

git: show which files have changed between kernel 3.18.6 and 3.18.7

I have checked out linux kernel git repository git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git I know how to use git log, git show and similar commands to see changes/...
6
votes
1answer
1k views

How does this git alias work?

Usually, git aliases are confined to a single command: git config --global alias.ci commit So, instead of git commit you could do git ci But it seems you can insert a function in there as well: ...
6
votes
2answers
3k views

Is it possible to store user's crontab in user's git repository on OpenBSD?

On OpenBSD and with OpenBSD's cron and crontab, is it possible to store the crontab(5) of a user in a git repository of the same user? What would be the proper way to accomplish something like this? ...
4
votes
2answers
183 views

Is it possible to restrict certain commands from being run in a directory?

I have two directories: src and projects. I would like to prevent myself from running git ... unless I am specifically inside src or projects. Is this possible?
4
votes
3answers
2k views

Git Bash - ls show git repo folders

I have a folder, /c/Tools, with three folders. I want a command like below $ ls --show-repositories Tools is NOT a git repository, but Tools/MyProject and Tools/MyApp both are. The output I want ...
3
votes
3answers
2k views

Conditional PS1

I'm basically trying to make my PS1 look like this when in a git repo: $ ~/Projects/Blah (master): Or if I'm not in a Git repo, I want it to look like this: $ ~/Projects/Blah: This is my current ...
3
votes
2answers
1k views

In a Virtualbox VM how do I set the filesystem permissions?

I have a virtualbox VM with arch Linux running on my windows PC (which I unfortunately have to use for work). I use this to work on my windows PC with a Linux environment as an alternative to Cygwin. ...
2
votes
2answers
3k views

Is it possible to set the users .gitconfig (for git config --global) dynamically?

I have the problem, that we login to the systems as our own users johndoe and then have to do a sudo su - root to be able to do administrative tasks. We have the system config files in a git ...
9
votes
5answers
23k views

Unmet dependencies while installing Git on Debian

I am attempting to install git on Debian 8.6 Jessie and have run into some dependency issues. What's odd is that I didn't have any issues the few times I recently installed Git in a VM while I was ...
4
votes
1answer
425 views

`less` performs differently when invoked from Bash and from Git

When I view a large diff with git diff, it gets paged with less. This is confirmed by opening another window and checking data from ps -aux and /proc. However, when less is invoked by Git, it does ...
4
votes
1answer
3k 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 ...
3
votes
2answers
2k views

how to perform git push using crontab

I'm using crontab for synchronizing git repositories. I was able to do operations like git add and commit, but can't perform git push to origin, since every git push asks for a password. How can I ...
3
votes
1answer
7k views

Permissions issue with git

I have a development machine that use runs on CentOs. Whenever i pull from git using git pull i get "permission denied" issue/error. Git apparently doesn't have the permission to overwrite the ...
3
votes
2answers
3k views

Git alias multi-commands with ; and &&

I want to have an alias that execute a command and then whether it fails or no it execute other commands that depends on the success of each other. So I have something like that in .gitconfig ...
2
votes
1answer
311 views

Create meaningful etckeeper commit messages

I want to keep track of the /etc changes with etckeeper Unfortunately, the commit messages are the same for all commits saving uncommitted changes in /etc prior to emerge run I wish there would be ...
2
votes
2answers
72 views

What optimized tools are available for comparing directory contents?

I am mirroring a Subversion repository tag with svn2git and I want to be sure that when I checkout particular revisions, those I obtain from the git mirror match those from Subversion. My main problem ...
2
votes
1answer
1k views

How do I apply this revert commit patch from git?

I have found a patch applicable to my system to fix a problem but I have no idea how to get this patch and then apply it. Can anybody help me please? Patch: https://git.kernel.org/cgit/linux/kernel/...
2
votes
2answers
575 views

Cron job not behaving as expected

So I have a python script that pulls down git/svn/p4 repositories and does some writing to a database. I'm simply trying to automate the running of this script and based from what I see in syslog it ...
1
vote
2answers
216 views

Why do I need 3 git repositories for ikiwiki if I want to commit locally

If I have a local ikiwiki on my laptop I need a "repository" directory (mywiki.git - a bare repository), a "scrdir" (myiki a git repository) and a place where the produced html files go ("destdir") to ...
1
vote
1answer
1k views

Crontab with SVN and Git

I have some repos which are both in SVN and Git. My username is guyfawkes, and in my home directory I have folder www which contains all my repos. In this directory I also have file update.sh: [...
1
vote
2answers
53 views

where is the 'Editor' variable kept in git?

I cloned a repo (using fictious examples here) $ git clone http://someplace.somedomain.name/resource.git went to the directory $ cd resource and then tried to edit a file within the resource ...
1
vote
1answer
279 views

Dynamic user config for git with wrapper script?

We are in the process of moving from other source/version control methods to git and, because I have no actual experience with git (short of setting some user.* variables), I'd like to ask whether ...