Questions tagged [git]

is for Emacs support of Git, the distributed version control system. Emacs version-control feature supports many systems besides Git. Additional extensions, such as Magit, also provide extensive Git support. Therefore use additional tags besides git for Git related questions.

Git is an open-source distributed version control system (DVCS) with an emphasis on speed. Git was initially designed and developed by Linus Torvalds for Linux kernel development, now it is maintained by Junio Hamano. Every Git working directory contains a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server.

There are many resources and tutorials available free online for Git beginners; see the bottom of this page for links to some of these resources.

Characteristics

  • Strong support for non-linear development
  • Distributed development
  • Compatibility with existing systems/protocols
  • Efficient handling of large projects
  • Cryptographic authentication of history
  • Toolkit-based design
  • Pluggable merge strategies
  • Garbage accumulates unless collected
  • Periodic explicit object packing

Data structures

git - data workflow

External Links

Internal Links

Installation/Setup

Working with the code

Tagging, branching, releases, baselines

Git Clients

  • msysgit - Cross platform, included with Git
  • gitk - Cross platform history viewer, included with Git
  • gitnub - Mac OS X
  • gitx - Mac OS X history viewer
  • smartgit - Cross platform, commercial, beta
  • tig - console GUI for Linux
  • qgit - GUI for Windows, Linux
  • Git Extensions - package for Windows, includes friendly GUI
  • SourceTree - A free Git & Mercurial client for Windows or Mac
  • posh-git - A Windows PowerShell environment for Git

Any other common tasks a beginner should know?

Other Git beginner's references

Delving into Git

Comparison of revision control software

267 questions
120
votes
3 answers

How to merge Git conflicts in Emacs

My recent Git merge has resulted in a large number of conflicts. My current approach is to search for the next occurence of '<<<' and then perform the merge by standard text editing. Question: is there a way Emacs can support merging using the…
Beginner
  • 2,711
  • 3
  • 18
  • 25
19
votes
2 answers

How can I use emacs with git within the terminal?

I've used git config --global core.editor emacs to set my git editor as emacs but when I do that and commit something the editor opens up a new window instead of opening emacs within the terminal. I want to use emacs as if -nw were given to it but…
MarMar
  • 293
  • 1
  • 1
  • 5
14
votes
1 answer

Is there bitbucket integration for emacs?

I am looking for listing pull requests on bitbucket that I created from emacs. I found this https://github.com/tjaartvdwalt/bitbucket.el, which seems to be incomplete. Is there any other package out there which will full fill my requirement?
noorul
  • 241
  • 2
  • 6
12
votes
1 answer

How can I make 'git diff' aware of Emacs Lisp functions?

When diffing with Git, for most languages, it provides a function name in the chunk header, allowing to get a better grasp on the context, e.g., @@ -7,5 +7,6 @@ int main() { if(condition()) { task4(); task5(); + task6(); } } For…
kdb
  • 1,561
  • 12
  • 24
6
votes
1 answer

Auto refresh buffer upon git checkout

When I use git checkout to change to a different state of a project with files open in emacs with different state, the files are not changed automatically. Instead on any modify attempt, emacs is asking to modify or revert etc the file. Typing r is…
sçuçu
  • 285
  • 1
  • 10
5
votes
2 answers

What is the work-flow for applying a patch?

Let's say I have this patch file from emacs git. I usually fix stuff manually by reviewing the patch files. But I am sure there is an automated way to do that. I played a bit by opening package.el in emacs source and trying to use ediff-patch-file…
Kaushal Modi
  • 25,651
  • 4
  • 80
  • 183
2
votes
2 answers

Open the same file on a different commit

I have a local git repository with a certain git commit checked out. A running emacs instance has an open file inside one of the buffers. How do I quickly open the same file inside a new buffer, but on a different commit? The use case is to have a…
anon2328
  • 71
  • 5
1
vote
1 answer

How to deal with packages when manage .emacs.d file with version control system?

I'm trying to use git to manage my .emacs.d directory. I occur this problem: Some package files are already managed by package-tools such as el-get,package.el via git. If I add them into my git repository, I met the submodule problem, which makes…
Nick
  • 4,473
  • 4
  • 26
  • 44
1
vote
1 answer

Git commit line length constraints

I'm quite new to emacs and a lot of the documentation I'm finding online is going over my head a bit at the moment. I've been using emacs as my git editor for a while now by mostly eye-balling reasonable line lengths but it's not at the point where…
1
vote
2 answers

How can I enable git auto-commit on a per-file basis?

Can I perhaps add a hook via local variables in the file header?
Lenar Hoyt
  • 1,173
  • 7
  • 25
0
votes
1 answer

Navigating through the vc revisions of a file

There is any command/package that allows me to move back and forth through the vc history of a file, updating the buffer to display the previous/next revision of that file? Let's say I have a file with 3 commits/versions, and I'm viewing the current…
Math
  • 103
  • 2
0
votes
1 answer

crux-delete-file-and-buffer (Please commit or undo your changes before deleting)

I try to run crux-delete-file-and-buffer, but it gives me: vc-delete-file: Please commit or undo your changes before deleting Why can't it just delete it?;)
Jason Hunter
  • 709
  • 4
  • 10
0
votes
1 answer

Insert a string to the git-commit message buffer

I have configured git to use emacs as editor for writing commit messages (with (start-server) in my init.el). I now want to put a template message (e.g. Bug #1234:) on top of the commit message buffer (so that it's on top of every commit message).…
Student
  • 103
  • 3
0
votes
1 answer

there is no info of author in git-timemachine

git-timemachine is good to use, but how to show author (committer) along side with the commit message?This information sometime is important for me
Daniel Wu
  • 1,751
  • 2
  • 17
  • 26