Skip to main content

Pushing changes to GitHub from GitHub Desktop

As you commit changes to your project locally, you can push those changes to GitHub from GitHub Desktop so that others may access them from the remote repository.

Qui peut utiliser cette fonctionnalité

People with write permissions can push changes to a repository.

About pushing changes to GitHub

When you push changes, you send the committed changes in your local repository to the remote repository on GitHub. If you change your project locally and want other people to have access to the changes, you must push the changes to GitHub.

Before pushing changes, you should update your local branch to include any commits that have been added to the remote repository. If someone has made commits on the remote that are not on your local branch, GitHub Desktop will prompt you to fetch the new commits before pushing your changes to avoid merge conflicts. For more information, see "Syncing your branch in GitHub Desktop."

Les administrateurs de dépôt peuvent activer des protections sur une branche. Si vous travaillez sur une branche protégée, vous ne pouvez pas supprimer une branche ni forcer une poussée (push) vers la branche. Les administrateurs de référentiel peuvent également activer d’autres paramètres de branche protégée pour appliquer des workflows spécifiques avant qu’une branche ne puisse être fusionnée. Pour plus d’informations, consultez « À propos des branches protégées ».

Repository administrators can also enable rulesets for a branch, which will prevent a push from completing if a ruleset has not been followed. For example, a ruleset may require a specific branch naming convention, or an issue number at the start of a commit message. GitHub Desktop will warn about rulesets to help prevent your branch from getting into a state where you would be unable to push your changes. For more information, see "À propos des ensembles de règles."

Pushing changes to GitHub

Note: GitHub Desktop will reject a push if it exceeds certain limits.

  • A push contains a large file over 100 Mio in size.
  • A push is over 2 Gio in total size.

If you configure Stockage Fichiers volumineux Git to track your large files, you can push large files that would normally be rejected. For more information, see "About Git Large File Storage and GitHub Desktop."

  1. Pour envoyer (push) vos modifications locales vers le dépôt distant, dans la barre du dépôt, cliquez sur Envoyer l’origine.

    Capture d’écran de la barre du dépôt. Un bouton, intitulé « Origine de l’envoi », est mis en évidence avec un encadré orange.

  2. If there are commits on the remote branch that you don't have on your local branch, GitHub Desktop prompts you to fetch new commits from the remote. In the "New Commits on Remote" window, click Fetch.

  3. Optionally, click Preview Pull Request to open a preview dialog where you can review your changes and begin to create a pull request. For more information, see "Creating an issue or pull request from GitHub Desktop."

    Screenshot of the "No local changes" view. A button, labeled "Preview Pull Request", is highlighted with an orange outline.

Further reading