Questions tagged [dulwich]

Dulwich is a Python implementation of Git.

Dulwich is a Python implementation of Git.

47 questions
3
votes
1 answer

dulwich's NotCommitError when trying to resolve tags

I'm working with dulwich on a project where I need to clone repositories sometimes by commit ID, sometimes by tag, sometimes by branch name. I'm having trouble with the tag case which seems to work for some repositories, but not for others. Here's…
shinzer0
  • 227
  • 2
  • 6
3
votes
1 answer

Dulwich: How to automatically stage modified files

In git command line, we can use git commit -a. How can I do that using dulwich?
Determinant
  • 3,886
  • 7
  • 31
  • 47
3
votes
2 answers

Programmatically `git status` with dulwich

I'm wondering how I can perform the equivalent of git status with dulwich? I tried this: After adding/changing/renaming some files and staging them for commit, this is what I've tried doing: from dulwich.repo import Repo from dulwich.index import…
sholsapp
  • 15,542
  • 10
  • 50
  • 67
2
votes
1 answer

How to get URL of remote in Dulwich

I want to be able to get a URL like https://github.com/user/repo.git given a remote name such as origin. So far I have only managed to get the commit hash: >>> from dulwich import porcelain >>> hash =…
Dull Bananas
  • 892
  • 7
  • 29
2
votes
1 answer

Working with branches in Dulwich (access objects / checkout)

I have a problem with Dulwich (switched to it from GitPython because of the well-known Windows bug with opened files in .git folder). I'm trying to get a file from another branch of currently opened repo (its state from last commit). In GitPython…
2
votes
2 answers

Cloning with dulwich using SSH - get dulwich to know the public key (Hangup Exception)

I managed to clone using dulwich with HTTP url, but when I try to clone with SSH, I get a "HangupException". Is it possible that dulwich doesn't get access to the public key in the ~/.ssh folder, and then doesn't manage to do the SSH connection ?…
A. Clare
  • 57
  • 5
2
votes
1 answer

Create an orphan branch without using the orphan flag

I have an existing repo with some branches. I want to create a new branch without any history on that repo. I'm trying to do this using Dulwich, which supports most git operations, though not the orphan flag. What are the equivalent Git operations…
user3715648
  • 1,498
  • 3
  • 16
  • 25
2
votes
1 answer

How to fetch using dulwich in python

I'm trying to do the equivalent of git fetch -a using the dulwich library within python. Using the docs at https://www.dulwich.io/docs/tutorial/remote.html I created the following script: from dulwich.client import LocalGitClient from dulwich.repo…
meatballs
  • 3,917
  • 1
  • 15
  • 19
2
votes
1 answer

Dulwich Remote Repo Authentication

Are there any good examples out there for accessing and fetching a remote repository over HTTPS? I have a Git repository that I can clone from the command line with my username and password, but I want to be able to do this using Dulwich and just…
sulimmesh
  • 693
  • 1
  • 6
  • 23
2
votes
1 answer

Dulwich ~ push to a certain branch

I would like to do the following with dulwich in an existing git repo: change a file commit push to a certain branch (not master) I read the documentation and also this post on SO, but I don't get it. Can someone explain how to chose a specific…
user937284
  • 2,454
  • 6
  • 25
  • 29
1
vote
1 answer

add tag / push tags to remote in Python Dulwich

I like the Dulwich project as it provides pure Python interface to interacting with git. It looks pretty low-level though... While I couldn't find reference on how to perform simple tasks. My need's are pretty simple, provide the same as below git…
Vano
  • 1,416
  • 1
  • 13
  • 26
1
vote
2 answers

One-line code change staged by Dulwich shows every line different

I have a file with a one-line change: git status reports S:\mydir\AEL>git status CodingTools_SourceControl.ael On branch master Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout --…
BoarGules
  • 16,440
  • 2
  • 27
  • 44
1
vote
1 answer

Not able to clone using dulwich python

I am trying clone a repository from a remote gitlab server using the python dulwich module. However I am getting the following error : socket.error: [Errno 10061] No connection could be made because the target machine actively refused it. There is…
1
vote
2 answers

How to checkout specific files or directories with dulwich

I have a working checkout function based on dulwich: def checkout(repo, ref=None): if ref is None: ref = repo.head() index = repo.index_path() tree_id = repo[ref].tree build_index_from_tree(repo.path, index,…
meatballs
  • 3,917
  • 1
  • 15
  • 19
1
vote
1 answer

Python: git remote add with Dulwich

i use git to remote data. This is my code. from dulwich.repo import Repo from dulwich.server import DictBackend, TCPGitServer repo = dulwich.repo.Repo.init('remote', mkdir=True) backend = DictBackend({'/': repo}) dul_server = TCPGitServer(backend,…
ikreb
  • 2,133
  • 1
  • 16
  • 35