Questions tagged [git]

Git is an open source distributed version control system originally designed and written by Linus Torvalds. It is generally used to keep track of source code for software projects. As a DVCS, Git provides powerful help with branching, merging, and distributed development.

Filter by
Sorted by
Tagged with
124 votes
8 answers
60k views

Forward SSH traffic through a middle machine

SSH tunneling is very confusing to me. I am wondering if I can do this in Linux. I have 3 machines.. A. My local machine at home. B. Machine at work that I can SSH into (middle man). C. My desktop ...
user avatar
985 votes
25 answers
1.1m views

How to tell git which private key to use?

ssh has the -i option to tell which private key file to use when authenticating: -i identity_fileSelects a file from which the identity (private key) for RSA or DSA authentication is read.  The ...
user avatar
  • 11.2k
124 votes
6 answers
69k views

Git Bash Here in ConEmu

How do I create a right-click context menu entry to open Git Bash at a given folder within ConEmu? See Git Bash Here in Console2 for the equivalent question for Console2.
user avatar
94 votes
14 answers
62k views

How to get git-completion.bash to work on Mac OS X?

I have followed http://blog.bitfluent.com/post/27983389/git-utilities-you-cant-live-without to add git-completion.bash to my /opt/local/etc/bash_completion.d/git-completion and I put PS1='\h:\W$(...
user avatar
  • 3,473
20 votes
1 answer
7k views

Using the IdentityFile directive in ssh_config when AgentForwarding is in use

Is it possible to specify forwarded keys using the IdentityFile directive in .ssh/config? I ran into this quirk when trying to deploy some code via Capistrano/GIT on our production server. Both my ...
user avatar
  • 345
4 votes
2 answers
1k views

How to keep my OSX settings under version-control?

Coming from Linux, I've gotten in the habit of keeping my config files under a git repository. Since I got a macbook however, I've made a lot of tweaks through defaults write and preferences panels, ...
user avatar
  • 1,436
201 votes
9 answers
93k views

Can you GPG sign old commits?

Git now has the ability to sign commits with git commit -S, which is great, but sometimes I forget the flag to commit, and sometimes I mail myself patches which I apply with am, and that command doesn'...
user avatar
  • 3,556
2 votes
2 answers
8k views

GitHub for Windows not working after install

Today I have installed GitHub For Windows. I had installed GitHub for Windows earlier and at that time it worked fine, but due to some reason I had to uninstall it. Today when I installed GitHub ...
user avatar
  • 163
98 votes
4 answers
72k views

Using Multiple SSH Public Keys

I have a personal account and a company account on Unfuddle. On Unfuddle SSH keys can only be used on a single account, so I need to create a seperate SSH key on my laptop for both accounts. I ran ...
user avatar
  • 1,115
101 votes
11 answers
225k views

How should I set the PATH variable on my Mac so the Hombrew-installed tools are found?

Trying to set up Homebrew on a new Mac (on previous Macs I would install packages from source). The first package I tried to install was Git: $ brew install git Installation went OK, but which git ...
user avatar
  • 6,537
82 votes
11 answers
96k views

how do I add the 'tree' command to git-bash on Windows?

I'm using git-bash on Windows 7. I'd like to see a tree of the current directory. However: jcollum@DEVELOPER01 ~/Dev/express_coffee $ tree . sh....
user avatar
  • 4,601
47 votes
4 answers
18k views

Git Bash Here in Console2?

MSysGit installs a context menu item that opens a Git Bash prompt at the currently selected folder; however, this opens a cmd.exe window and I would like it to open in Console2 instead. What ...
user avatar
50 votes
4 answers
142k views

How do I disable password prompts when doing git push/pull?

Every time I want to push and/or pull from the terminal (in Linux) I have to enter a password. How do I remove this so that it pulls and/or pushes without the password?
user avatar
  • 777
22 votes
10 answers
25k views

How to upgrade Git on Ubuntu Hardy?

I have Git version 1.5.4.3 installed, but I think this must be an old version. I'm running Ubuntu Hardy 8.04. I need to install at least version 1.6 to get a Git GUI to work. How do I upgrade my ...
user avatar
  • 13.8k
6 votes
8 answers
9k views

Setting up SSH/Git on Cygwin yields "Bad permissions on ~/.ssh/config"

I'm attempting to setup Git with OpenSSH under Cygwin. I almost got everything setup. I have the agent and public key and all that.. but now I get this really weird error: $ git pull -u origin master ...
user avatar
  • 4,374
11 votes
2 answers
3k views

How to track $HOME with git

I would like to track my $HOME dir with git. I've got many other git repos in other subdirs (eg $HOME/projects/repo_1 and so on), which shouldn't be tracked, since they already are. I have found git-...
user avatar
  • 664
8 votes
1 answer
3k views

Encrypt files before sending them to Cloud

Recently I switched to GIT along and picked bitbucket to host my code. Now with all the snowden scandal, I decided to review my choices. I really don't want to host my data on my own server, I'd ...
user avatar
  • 219
7 votes
8 answers
2k views

Git Client for OS X & Windows? [closed]

Does anybody know of a stable release of a GUI Git Client? Preferrably one that can run on both Mac OS X & Windows..... Heard about SmartGit but it's still in Beta and i'm not sure I have time ...
user avatar
  • 341
3 votes
1 answer
2k views

Diff to HEAD with PHP Storm?

How can you see a Git diff to HEAD with PHP Storm? I'm trying to switch over to PHP Storm from NetBeans as I've heard that it's more powerful. But I can't see how to use the Git diff tool, which was ...
user avatar
  • 1,068
2 votes
2 answers
18k views

How to exit VIM and get back to 'normal' terminal?

I did find this answer here: Vim Stuck In Insert Mode However none of the commands listed worked for me. Exit, cntrl + [, cntrl + q I'm totally a terminal newb, trying to learn how to setup git ...
user avatar
  • 1,985
1 vote
1 answer
507 views

How to build a custom command with options

I want to make a command on my Mac to do the following: git add . git commit -m CUSTOM_COMMEND_BY_COMMAND git push cap deploy I seem to be calling those very often. I was wondering what's the best ...
user avatar
  • 243
1 vote
1 answer
72 views

Website updating from git (over ssh)

I have a script that I run over SSH, which updates my website from a Git repo. cd website-git git checkout master git pull # Update protected directory rsync -v -a --delete --exclude=db --exclude=...
user avatar
1 vote
2 answers
455 views

Why don't applications update by calculating difference?

I have Ubuntu computers and an Android phone, and it's always perplexed me why the default update manager on Ubuntu and Google Play on the phone don't update existing versions of applications by ...
user avatar
  • 133
181 votes
13 answers
267k views

How do I ensure Git doesn't ask me for my GitHub username and password?

I am working with a repo on GitHub and everytime I try to push something, it asks for my GitHub username and password. I don't want it doing that. I tried the instructions on setting your email in ...
user avatar
  • 2,527
196 votes
5 answers
153k views

Git - List all files currently under source control?

Is there a way to list all files currently under source control in git? (Not just those that have been modified).
user avatar
  • 2,391
87 votes
6 answers
101k views

How to make git not prompt for passphrase for ssh key?

I'm using git bash and I setup ssh key using ssh-keygen and each time I do something with a repo git ask me for passphrase for /c/Users/jankiewj/.ssh/id_rsa. Is there a way to disable that passphrase. ...
user avatar
  • 2,563
88 votes
5 answers
18k views

Using Git across multiple systems without network access

I want to use version control but, due to security reasons, the server I'm working on has no internet access: I can only move files on a USB flash drive. Can I still use Git with this setup? Can I ...
user avatar
40 votes
6 answers
21k views

Can you specify git-shell in .ssh/authorized_keys to restrict access to only git commands via ssh?

I'd like to be able to use a ssh key for authentication, but still restrict the commands that can be executed over the ssh tunnel. With Subversion, I've achieved this by using a .ssh/authorized_keys ...
user avatar
44 votes
4 answers
19k views

Tmux and ZSH custom prompt : bug with window name

I have customized my ZSH prompt with oh-my-zsh to make it more readable and add information about git if I'm in a repository. Example : bob@inf [~/docs] % bob@inf [~/src/nicest] master % (in a git ...
user avatar
49 votes
3 answers
22k views

Setting up an encrypted git-repository

Situation Hi, I would like to save data with git, encrypted (on some platform like bitbucket or github). Therefore the question: Question I am looking for different hassle-free ways on: How to set ...
user avatar
  • 621
59 votes
1 answer
225k views

How can I merge two branches without losing any files?

I have two branches with the following files in there: branch a: file_a file_b file_c branch b: file_a file_d file_e I want to merge them, so that I get both files from a and b (and files that ...
user avatar
  • 975
36 votes
4 answers
15k views

Rewrite git history to replace all CRLF to LF?

I'm going to transfer a private Git repository from win32 box to Ubuntu. Though I can do a final dos2unix commit, but I'd like to rewrite the whole history, so some Git GUI will display log/diff ...
user avatar
  • 17.1k
34 votes
2 answers
8k views

How do i get the git pager to clean up screen output after exit?

The pager less doesn't clear the screen as it should do when i use git. I use less all the time and it usually doesn't leave output in the terminal after quit but when less gets executed via git it ...
user avatar
  • 1,944
48 votes
4 answers
95k views

Git: How to delete all untracked files?

I'm using Git for version control. Now I want to delete on my local machine all files in the repository that are not tracked. I can use git status to list these files, but how can I delete all of ...
user avatar
47 votes
5 answers
24k views

How can I enable colored output for OSX diff?

I need to diff two files (not two versions of the same file, they are however tracked by git, but that is unrelated) and I would like some colored output, how can I achieve that? $ diff file_1 file_2 ...
user avatar
  • 949
49 votes
4 answers
7k views

Cache the password if SSH-keys are forbidden

I have a server which I have to access frequently via ssh, because I compute on it. Now, the computing center explicitly forbids SSH-keys because they are "insecure". They feel that typing my password,...
user avatar
13 votes
3 answers
11k views

Despite the fact that GIT does NOT store file deltas, can you still rollback to previous file versions (unlimited times?)

I've read that Git does not store file deltas. If this is true, how does it support file rollback to previous versions? If it's storing the entire file the repository space on disk must grow to be ...
user avatar
21 votes
3 answers
20k views

Checkout Git files to a location outside the repository

Is it possible to “checkout” to a location outside of the repository? What I mean is a clone of a branch without the “.git” directory. For example: Use git to manage a website. You edit some files, ...
user avatar
17 votes
2 answers
22k views

How can I limit the size of the Android source I need to download with "repo sync"?

I'm planning to leave for a country with a poor Internet connection, where I hope to do some software development. I have been using repo sync to sync the Android source (and the CyanogenMod source ...
user avatar
  • 303
50 votes
4 answers
18k views

Does Git delete empty folders?

I deleted all files from a directory in my work folder, but the directory itself still exists. After pushing the changes to a remote repository (GitHub) I checked my project and noticed that the ...
user avatar
11 votes
2 answers
9k views

How do I create a cron job that will commit my project changes to git on a weekly basis

I'm using git for the purposes of making a historical transcript of the changes made to my project. I understand it's not the ideal usage but it's the usage pattern I've chosen for various reasons ...
user avatar
  • 1,779
44 votes
5 answers
16k views

Mark file as “uncommitable” with Git

I want to show off some of my work by uploading them to my GitHub account. However, there are some files that contain passwords, like database connections. Is there a way of marking a file as ...
user avatar
8 votes
5 answers
18k views

Installing Git on CentOS [closed]

How install git on CentOS? I find this manual. Is it good?
user avatar
20 votes
4 answers
57k views

I can't uninstall Git

I was researching Git so I downloaded the Windows version to test it out on a repository on GitHub. After about 30 minutes I couldn't work out how to use it, so I decided I probably wouldn't need a ...
user avatar
17 votes
2 answers
41k views

git pull does nothing / git push just hangs / debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

I had an issue in ubuntu 13.10 and 12.10 where attempting to connect to github (git clone / pull / push or anything) would fail with no output. I checked my /.ssh directory for config and any ssh ...
user avatar
  • 1,779
16 votes
7 answers
14k views

Using git through cygwin on windows 8

I've got a windows 8 dev preview (not sure if it's relevant, but I never had this hassle on w7) machine and I'm trying to clone a git repo from github. The problem is that my ~/.ssh/id_rsa has 440 ...
user avatar
  • 417
11 votes
2 answers
6k views

Tweaking zsh git autocompletion

I just switched from bash to using zsh 4.3.4 on Ubuntu Hardy. I'm developing with git and I find myself constantly fighting with the default git completions: filename completion tries to be smart by ...
user avatar
  • 1,043
9 votes
2 answers
11k views

Use cygwin executable in git bash script

I have a .sh script that I double-click to have it executed by git for Windows. Now I need (imagemagick) convert from cygwin (which I have installed) and I'm calling it with its absolute path - /c/...
user avatar
  • 101
6 votes
1 answer
4k views

Where is my zsh getting its git completion settings?

My zsh does git completion, but I did not configure this myself. How can I figure out where these settings are coming from?
user avatar
  • 1,329
3 votes
1 answer
736 views

Git vs SVN: website storage efficiency [closed]

I know that SVN (Subversion) stores files' deltas in order to efficiently store data. Git however, is a little more complex. What I'm wondering is that if I were to store plain HTML, image and js ...
user avatar