nodegit / nodegit/nodegit

Discrepancy while making the first push to a remote

Abierto
#1,563 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
JavaScript
Estrellas
5.8k
Forks
704
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

System information

  • node version: 8.9.3
  • npm or yarn version: 6.4.1
  • OS/version/architechture: Win10 - 64 bit
  • Applicable nodegit version: 0.22.2 ia32
node -v
npm -v # (or yarn -v)
node -e "console.log(process.platform)"
node -e "console.log(require('os').release())"
node -e "console.log(console.log(process.arch))"

I am creating a new git repo using the example at https://github.com/nodegit/nodegit/blob/master/examples/push.js . I am also creating a "remote" locally by creating a bare repository in another folder and pointing to this folder while creating the remote.

All the steps pass successfully but on git status I find the output as

On branch master
nothing to commit, working tree clean

and git log as

commit add9654497514765a07f40e85f2413e9fa7cfe77 (HEAD -> master, origin/master)
Author: <the author>
Date:   Sun Oct 7 21:10:42 2018 +0530

    Initial Commit

Notice how Git log mentioned the origin.

So, while debugging, I pushed the local repository and checked the git status again and voila, it showed:

On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

The git log remained the same as before.

So, I checked what changed in my .git folder before and after the push. And I found that the config file inside the .git folder had changed from

[core]
	bare = false
	repositoryformatversion = 0
	filemode = false
	symlinks = false
	ignorecase = true
	logallrefupdates = true
[remote "origin"]
	url = my-path/Repo.git/
	fetch = +refs/heads/*:refs/remotes/origin/*

to

[core]
	bare = false
	repositoryformatversion = 0
	filemode = false
	symlinks = false
	ignorecase = true
	logallrefupdates = true
[remote "origin"]
	url = my-path/Repo.git/
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

What is happening here? Is this a bug?

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con examples/push.js y compara la configuración del repositorio antes y después del primer push, especialmente la sección [branch "master"] que se muestra en el informe. Determina si la falta de configuración de tracking es un comportamiento esperado o un error de NodeGit, y documenta la causa y un resultado reproducible.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
git, javascript, node.js
Área
devtools
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.