A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rejeep/git.el below:

rejeep/git.el: An Elisp API for programmatically using Git

An Elisp API for programmatically using Git.

Add git to your Cask file:

Documentation and examples

Return true if there is a git repo in DIRECTORY, false otherwise.

(git-repo? "/path/to/git/repo") ;; => t
(git-repo? "/path/to/svn/repo") ;; => nil

Return true if there's a branch called BRANCH.

(git-branch? "existing") ;; => t
(git-branch? "non-existing") ;; => nil

Return true if there's a tag called TAG.

(git-tag? "existing") ;; => t
(git-tag? "non-existing") ;; => nil

Return true if BRANCH is currently active.

(git-on-branch? "current") ;; => t
(git-on-branch? "other") ;; => nil

Return true if remote with NAME exists, false otherwise.

(git-remote? "existing") ;; => t
(git-remote? "non-existing") ;; => nil

Return currently active branch.

(git-on-branch) ;; => "current-branch"

List all available branches.

(git-branches) ;; => '("master" "foo" "bar")
git-log (&optional branch)

Log history on BRANCH.

(git-log)
(git-log "foo")

Return list of all remotes.

(git-remotes) ;; => '("remote-1" "remote-2")

Return list of stashes.

(git-stashes) ;; => (:name "..." :branch "..." :message "...")

Return list of all tags.

(git-tags) ;; => '("tag-1" "tag-2")

Return list of untracked files.

(git-untracked-files) ;; => '("file-1" "file-2")

Return list of staged files.

(git-staged-files) ;; => '("file-1" "file-2")

Add PATH or everything.

(git-add)
(git-add "foo")
(git-add "foo" "bar")

Create BRANCH.

Checkout REF.

git-commit (message &rest files)

Commit FILES (or added files) with MESSAGE.

(git-commit "add foo" "foo")
(git-commit "add foo and bar" "foo" "bar")
(git-commit "add em all")
git-init (&optional dir bare)

Create new Git repo at DIR (or `git-repo').

If BARE is true, create a bare repo.

(git-init)
(git-init "foo")
(git-init "foo" :bare)
git-remote-add (name url)

Add remote with NAME and URL.

(git-remote-add "foo" "foo@git.com")

Remove remote with NAME.

(git-remote-remove "foo")

Reset to COMMIT with MODE.

(git-reset)
(git-reset "HEAD~1" 'hard)

Remove PATH.

To remove directory, use RECURSIVE argument.

(git-rm "foo")
(git-rm "bar" :recursive)
git-stash (&optional message)

Stash changes in a dirty tree with MESSAGE.

If a stash was created, the name of the stash is returned, otherwise nil is returned.

(git-stash)
(git-stash "foo")
git-stash-pop (&optional name)

Apply and remove stash with NAME (or first stash).

(git-stash-pop)
(git-stash-pop "stash@{3}")
git-stash-apply (&optional name)

Apply and keep stash with NAME (or first stash).

(git-stash-apply)
(git-stash-apply "stash@{3}")

Create TAG.

git-clone (url &optional dir)

Clone URL to DIR (if present).

(git-clone "foo@git.com")
(git-clone "foo@git.com" "bar")
git-fetch (&optional repo ref)

Fetch REPO.

(git-fetch)
(git-fetch "origin" "master")
git-pull (&optional repo ref)

Pull REF from REPO.

(git-pull)
(git-pull "origin" "master")
git-push (&optional repo ref)

Push REF to REPO.

(git-push)
(git-push "origin" "master")
git-run (command &rest args)

Run git COMMAND with ARGS.

(git-run "log")
(git-run "log" "--name-only")
;; ...

For each command, you can add arguments using git-args.

(let ((git-args "--hard"))
  (git-reset "HEAD"))

Be sure to!

Install Cask if you haven't already.

Run the unit tests with:

Do not change README.md directly. If you want to change the README or if you change any function comments, update the README with:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4