Many files can be renamed directly on GitHub Enterprise, but some files, such as images, require that you rename them from the command line.
Este procedimiento supone que ya has:
- creado un repositorio en GitHub Enterprise o que tienes un repositorio existente que es propiedad de alguien más con quien desees colaborar
- clonado el repositorio de forma local en tu computadora
- Abre la TerminalTerminalGit Bash.
- Cambia el directorio de trabajo actual por tu repositorio local.
- Rename the file, specifying the old file name and the new name you'd like to give the file. This will stage your change for commit.
$ git mv old_filename new_filename
- Use
git status
to check the old and new file names.$ git status > # On branch your-branch > # Changes to be committed: > # (use "git reset HEAD
..." to unstage) > # > # renamed: old_filename -> new_filename > # - Confirma el archivo que has preparado en tu repositorio local.
$ git commit -m "Rename file" # Commits the tracked changes and prepares them to be pushed to a remote repository. # Para eliminar esta confirmación y modificar el archivo, usa 'git reset --soft HEAD~1' y confirma y agrega nuevamente el archivo.
- Sube los cambios en tu repositorio local a tu instancia de servidor de GitHub Enterprise.
$ git push origin your-branch # Pushes the changes in your local repository up to the remote repository you specified as the origin