Tengo un directory local en mi máquina con Windows que bash:
git init
README.md
a este repository Sin embargo, tengo problemas con los commands (pasos 2 y 3.) que vienen después de git init
He intentado esto:
git init --bare tHartman3 git remote rm origin git add -A git remote add origin https://bitbucket.org/<username>/tHartman3
Ahora, estoy listo para comprometerme, así que bash:
git commit -m "Created blank README.md file for tHartman3 repository"
pero da el siguiente error
On branch master nothing to commit, working tree clean
Entonces bash
git push -u origin master
Pero esto da este error
remote: Not Found fatal: repository 'https://bitbucket.org/<username>/tHartman3/' not found
Cuando solo bash
git push
Me sale este error
fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master
No estoy seguro de lo que está pasando con esto ya que:
git remote add origin https...
parece haber funcionado. git remote -v
ve bien He seguido las instrucciones desde aquí y aquí .
Notas adicionales:
git remote add origin https://bitbucket.org/<username>/tHartman3
o git remote add origin https://bitbucket.org/<username>/tHartman3.git
Todavía obtengo el mismo resultado para todos los demás seguidores commands. Pregunta
¿Hay algo que falta aquí para crear este directory tHartman3
local en un repository .git
?
Primero y principal, crea el repository remoto en BitBucket. Necesitas esto para poder presionarlo. Empujar solo funciona si hay algo a lo que presionar en el otro extremo. Aquí hay algunas instrucciones fuera del sitio: https://confluence.atlassian.com/bitbucket/create-and-clone-a-repository-800695642.html
Una vez que tiene un repository, tiene un par de opciones para get una copy local de trabajo. La forma más difícil es hacer el repository (no puro) y configurar el control remoto manualmente:
git init tHartman3 git remote add origin ssh://<username>@bitbucket.org/<username>/tHartman3
Tenga en count que los repos sin formatting no tienen un directory de trabajo. Se usan prácticamente solo para alojar un repository central, ya que no se puede verificar ningún file en ellos.
La forma más fácil de hacer un clon local es ejecutar el command que bitbucket muestra cuando haces clic en el button de clonación:
git clone ssh://<username>@bitbucket.org/<username>/tHartman3
Ahora puede agregar su file léame y ejecutar git -A
. Antes de comprometerse, generalmente es una buena idea ejecutar el git status
. Si no tiene ningún file en etapas, la confirmación fallará. Agregue los files que necesita manualmente en ese caso:
git add README.md
Ahora la confirmación y el empuje deberían funcionar sin problemas:
git commit -m '...' git push