Giter Club home page Giter Club logo

sublime-text-git's Introduction

Build Status

Sublime Text plugin: git

Git integration: it's pretty handy. Who knew, right?

For more information about what's supported, and how to install this, check the wiki.

Install

Package Control

The easiest way to install this is with Package Control.

  • If you just went and installed Package Control, you probably need to restart Sublime Text before doing this next bit.
  • Bring up the Command Palette (Command+Shift+p on OS X, Control+Shift+p on Linux/Windows).
  • Select "Package Control: Install Package" (it'll take a few seconds)
  • Select Git when the list appears.

Package Control will automatically keep Git up to date with the latest version.

Basic Usage

  • Bring up the Command Palette (Command+Shift+p on OS X, Control+Shift+p on Linux/Windows).
  • Start typing "Git" and select one of the recommended commands.

The rest

If you don't want to use Package Control, check the wiki for other installation methods on various platforms.

Troubleshooting

This package works by running commands as your system git. As such, if you have problems with this package, first make sure that git is installed and configured correctly on your system.

You may want to make sure that the git binary this plugin is using is the correct one, if you have multiple ones installed. Most git installation guides will be happy to walk you through configuring your system $PATH appropriately.

If necessary, set the git_command plugin preference to tell us where to look.

fatal: unable to auto-detect email address

Git isn't configured properly. Tell it who you are, by opening a command prompt and doing this:

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

If you've done this and it's still complaining, you probably have multiple copies of git on your system which have different configuration locations, and the one which runs on your command line isn't the one which the shell $PATH exposes to Sublime Text.

fatal: could not read Username for 'https://github.com': Device not configured

Git isn't configured to use a system-level ssh-agent, and so it's asking you for a username and password when you try to push / pull. The plugin doesn't know how to ask you for this information.

Set up a ssh-agent and this will stop happening.

Acknowledgements

This package contains:

sublime-text-git's People

Contributors

bordaigorl avatar buhrmi avatar dacap avatar danieldk avatar derekleverenz avatar dzhlobo avatar fauxpark avatar idiomaticrefactoring avatar iurisilvio avatar kemayo avatar kronuz avatar misfo avatar nh2 avatar olivierlacan avatar pendrokar avatar peterpablo avatar pomeh avatar ptte avatar rahul-ramadas avatar rcopera avatar sheldon avatar singingwolfboy avatar spadgos avatar starli0n avatar sunnyagain avatar theanonmatrix avatar tomchentw avatar vanrijn avatar vespakoen avatar whitequark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublime-text-git's Issues

No Git in the Command Palette

Cant using any Commands due they simply missing in Command Palette.
I've tryed manual and Package Control Installation, git bin is in $PATH, git bin override also tryed.
git.pyc, and Blame/Commit/Graph caches files are created in the Git Package directory.
Sublime version is build 2126, OS is Windows 7 x64. git version 1.7.6.msysgit.0
how can i investigate further?

git status and then diff a file from the list

It doesn't work. Path of the file incorrect.

I've tried to add some python in there but first, I've never coded in python and second, it seems that the working directory of ST2 is always changing to the current open file so I don't really see how is it possible to 'guess' the path where the file we're trying to diff (from the list) is located.

Just to let you know.

Or I'm missing something.

Error Loading Syntax File

So I'm getting this:

It's trying to load from the wrongfolder, It's only been doing this since the recent updates. It should be looking in this folder sublime-text-2-git

See exact log after blame

hey!

This is a feature request...not a bug! :)

It would be great if it would be possible after doing blame I could copy the sha and find in log exact change via sha or somehow else.
It does not have to be as advanced as in fugitive (vim git plugin) => (:Gblame brings up an interactive vertical split with git blame output. Press enter on a line to reblame the file as it stood in that commit, or o to open that commit in a split. When you're done ..)

Br,
Grzegorz

Git checkout doesn't work on first attempt

I am running on OS X. After making local changes to a file and deciding to revert, I bring up the command dialog and issue git checkout. It does not work the first time, so I do it again and then it works. This seems like a relatively new issue.

git plugin crashes sublime_text.exe

Using msysgit - Git (version 1.7.6-preview20110708)
"Git: Blame" works, but "Git: Log (file)" and "Git: Log (repo)" both crash the Sublime Text 2 executable every time. I can give you an example repo to pull if you need one to reproduce the problem.

None of the commands work when a file is open

I am using the latest dev build of ST2. I am using a project file, whose only folder is a git repository.

With the project window open but no file buffers open, I can successfully Git: Status, Git: Diff All, Git: Log All.

I Cmd-P to open a file in the project folder (the git repo), and suddenly all of those commands fail.

Status: fatal: Not a git repository: .git

Diff All: usage: git diff [--no-index] <path> <path>

Log All: fatal: Not a git repository: .git

Commit not working

If I do Git: Commit, and it doesn't work it just says "Nothing to commit". All the other commands work fine (Git: Diff shows I have modified files, Git: Quick Commit works).

Great plugin though, I just wish it would work :)

Thanks

Sublime on Windows now supports --wait

As the ticket title says, Sublime 2 supports --wait on Windows now (to be precise, since Build 2179). This should allow a cleanup of the git commit command.

Show file history beyond file renames

It would be good for the log and graph command to show the file history beyond file renames. I've put together a commit which does this, however it does have a bug, so I didn't submit it for a pull request. Hopefully, someone could look at the code and fix it, or perhaps the bug is enough of an edge case to not worry about it?

The change simply adds "--follow" into the git log arguments, however, if you select a commit from the quick panel from when the current file was named differently, then you see no output.

Here's the commit:
spadgos@5ddfe36

OS X (Snow Leopard) - Cannot view log

Using Sublime Text 2 Build 2126

This works a treat on my Ubuntu netbook, but on OS X when I try to view the log for a file, I get no popup, and the following in the console:

Exception in thread Thread-1:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 522, in __bootstrap_inner
    self.run()
File "./git.py", line 77, in run
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in __init__
    errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

View log after blame

Hi,

Its not a bug but a feature request :)

It would be awesome if I would be able to:

do a BLAME
then on blame sha I could open this exact log (or just copy sha and find log based on this sha)

Br,
Grzegorz

Git Diff not working

When I use "Git Diff: Current File" or "Git Diff: All" when focused on a dirty file, I get a new buffer with the following text:

usage: git diff [--no-index] <path> <path>

That's not the usage of git diff I understand... Shouldn't it be doing git diff <path>?

This only recently started to happen.

Git diff should use --no-color

It currently includes color characters like \�[1m if colors are enabled. Using the --no-color flag this can be disabled.

git merge

When you select git merge, it would give you a list of all your branches just like when "change branch" except when you select it that branch gets merged into your current one.

(Also after we get that basic support maybe more complex one to deal with merging conflicts might be something add. I.e. http://sjl.bitbucket.org/threesome.vim)

could not checkout current file

Hi,

I''ve made changes into file then tried to checkout current file and below issue in sublime 2 console:

UnboundLocalError: local variable 'file_name' referenced before assignment
Traceback (most recent call last):
File "./sublime_plugin.py", line 282, in run_
File "./GitCommand.py", line 95, in run
UnboundLocalError: local variable 'file_name' referenced before assignment

Please check,

Br,
Grzegorz

no push to remote server

I can't seem to be able to push to a remote server, even if I try running a custom command with push "origin" master:master, where "origin" is the remote repository it doesn't work.

If I try and do a git push "origin" master:master from Git Bash (running under Windows) everything works OK. I even tried adding a id_rsa key with no passphrase to make sure that isn't the problem. Any ideas?

build 2181: annotate seems to not work

After updating to 2181, annotate feature seemed broke. I checked the color scheme configs to make sure the annotate colors were still configured, they were. I pulled up the terminal, fired git annotate, and get an exception...

heres the stack trace:

Exception in thread Thread-32:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "./git.py", line 96, in run
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 691, in communicate
return self._communicate(input)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1222, in _communicate
bytes_written = os.write(self.stdin.fileno(), chunk)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xcf' in position 8: ordinal not in range(128)

Add option to use console for status messages

Commit 33474d9 introduced the new way of handling status messages, by opening them in a scratch window.

Unfortunately, this interrupts my workflow, and slows things down, as i have to close the window to get back to my file editor.

Having the option to swap between the "new" and old method would be awesome

Documentation on diff syntax highlighting : colors incorrect

Need to target the Diff.tmLanguage when specifying colors:

markup.changed.diff
markup.inserted.diff
markup.deleted.diff

name Git Modified Line scope markup.changed.diff settings background #272852 name Git Added Line scope markup.inserted.diff settings background #275822 name Git Remove Line scope markup.deleted.diff settings background #A72822

Commit stopped working

I have no idea why, one day it seemed to work, now it doesn't.

I can provide needed files, but not sure what good they do.

Now when i close the commit message, nothing happens.

Quick commit still works, but not full commit

pull requests being ignored

I've merged a few pull requests on this repo together, and they all seem to be working fine. I'm not sure why they haven't been merged here, but perhaps kemayo doesn't have the time to look after this. If that's the case, I'd be happy to take over.

See https://github.com/sheldon/sublime-text-2-git for my fork with most of the pull requests merged. A few didn't merge cleanly so I left them out for now.

Quick Commit should use -am

Hi,

So an issue with the quick commit that almost makes it useless is that I have to go into the terminal and do a git add . before I use the git quick commit function in sublime. If you change it from just using -m to -am it will work perfectly by adding the files then committing them :)

Many thanks,

CJ

Git commands don't work in Sublime 2125 on OSX 10.6.8

When trying to execute a Git command from the plugin, I get the following error in the sublime console:

Exception in thread Thread-12:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 522, in __bootstrap_inner
    self.run()
  File "./git.py", line 47, in run
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Sublime version is Beta Build 2125
OSX Version 10.6.8
Python 2.6

Should be able to run "Whole Repo" commands when no files open

As per title. When there are no files/tabs open in SublimeText2, but you have an open project who's base directory is also a git repository, users should be able to run the commands from the Tools => Git => Whole Repo menu and via the Command Palette.

Currently, these commands are disabled when no files are open.

collaborator access

seems like you're not really keeping too much of an eye on this @kemayo , if you wouldn't mind I would love to have collaborator access to get some of my own stuff merged in, as well as other peoples'

up to you in the end, but if you don't have much time for it I don't mind helping out :)

"Git: Diff" preserves shell color codes

In my ~/.gitconfig I have:

[color]
  ui = always

This gives me colors in every part of git output. Unfortunately the "Git: Diff" command does not strip it nor does it pass the --no-color option.

Save All before changing branches

I can look into implementing this myself, but if someone wants to pick it up, it should be easy enough...

Could you have it either save all open documents or warn the user if there are open unsaved documents before changing branches? I often find that I change branches and I have open documents with unsaved changes which then sometimes get saved on the wrong branch...

Thanks a lot for the great plugin!

fatal: could not read log file: No such file or directory

I'm getting this error below often when trying to commit. If I do a quick commit it always works but regular commits often get this error.

fatal: could not read log file 'stylesheets/c:\users\me\appdata\local\temp\tmpcedjhf': No such file or directory

I'm using windows 7 64bit, Cygwin git and the latest ST and plugin.

commit doesnt ever see any changes

Not sure I am doing this wrong, but the Git plugin doesnt ever seem to think there are any pending changes...

things like git status work:

Git Diff

but git commit never sees any changes:

Git Diff

Am I doing something wrong here?

'git' is not recognized as an internal or external command, operable program or batch file.

I'm guessing this has something to do with:

"git_command: a path to your git binary if it's not in the $PATH available to Python (you'll get an error message if you need to set this)", so I tried to followed the comment in git.sublime-settings

// if present, use this command instead of plain "git"
// e.g. "/Users/kemayo/bin/git" or "C:\bin\git.exe"

I use Windows 7, and as far as I know the git binary is located at

C:\Program Files (x86)\Git\bin\git.exe

I also followed your wiki to the point where I copy the Git.sublime-settings from the Git folder to the User folder, but seems neither "C:\bin\git.exe", or in my case "C:\Program Files (x86)\Git\bin\git.exe" gives a invalid escape error. I tried JSON escaping with \ but still get the same error when testing git commands:

'git' is not recognized as an internal or external command, operable program or batch file.

Any ideas what I'm missing?

add key bindings

There should be an ability to add key bindings for git features such as custom git command

Add option to toggle --verbose commit messages

Commit 442b357 introduced verbose commit messages, which is useful for quick commits and similar fast functions, but for larger commits, it makes the comments on the commit message all but useless.

Adding an option for this would be most appreciated

[FEATURE] Browse through file history

Hi,

I like the idea of browsing current file history or just a history of marked part.

So it could work in 2 ways:

  1. I am on file and I could use some like 'git current file history' and it would show me the file one version before and so on...

  2. I could mark pice of code, and see its changes in file history

All those functionalities are in TextMate Git plugin.

Br,
Grzegorz

Git log command doesn't work

Using buld 2126, I get the following in the console after running 'git log all'

Traceback (most recent call last):
File ".\git.py", line 162, in log_done
AttributeError: 'NoneType' object has no attribute 'show_quick_panel'

Some weirdly encoded commit messages can make things fail

When I use git log option, I don't get any output but instead this error in the console:

Exception in thread Thread-45:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "./git.py", line 102, in run
File "./git.py", line 63, in _make_text_safeish
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/encodings/cp1252.py", line 15, in decode
return codecs.charmap_decode(input,errors,decoding_table)
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1217736: character maps to

I don't know exactly which commit causes the failure but it's probably encoded in something that is not utf-8 (windows-1251 or iso-8859-1).

Quick commit error on spaces in folders

If git.exe is in a path with folders that contains spaces i get this error:

'C:/Program' is not recognized as an internal or external command,
operable program or batch file.

Out of memory error

After working for some hours, the git commands in Sublime stopped working altogether. In the python console was this:

Exception in thread Thread-24:
Traceback (most recent call last):
  File ".\threading.py", line 532, in __bootstrap_inner
  File "./git.py", line 89, in run
OSError: [Errno 12] Cannot allocate memory

Now, I am working on a small netbook with limited memory, and doing a restart of Sublime fixed the problem, so feel free to mark this as "won't fix", but I thought I should report it anyway.

Error running any git command

The error I'm getting is:

'git' is not recognized as an internal or external command,
operable program or batch file.

I'm getting it when running Git: Add, Git: Commit, and every other git command available.

I'm using the latest Sublime Text 2 Beta and installed the git package via package control

Any Ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.