« RStudio et github » : différence entre les versions

mAucun résumé des modifications
mAucun résumé des modifications
 
(3 versions intermédiaires par la même utilisatrice non affichées)
Ligne 1 : Ligne 1 :
[[Catégorie:Tutoriel]]
[[Catégorie:Tutoriel]]


= Étapes pour commencer =
== Étapes pour commencer ==
 
* Créer un repo sur son compte github.
* Créer un repo sur son compte github.


Ligne 9 : Ligne 8 :
* Ouvrir le terminal depuis RStudio (Onglet git: ⚙️ => Shell)
* Ouvrir le terminal depuis RStudio (Onglet git: ⚙️ => Shell)
* Depuis le terminal: Ajouter l'origine distante:
* Depuis le terminal: Ajouter l'origine distante:
  <syntaxhighlight lang="bash"> git remote add origin git@github.com:lvaudor/nom_repo.git </syntaxhighlight> + créer une branche 'main' (suivre les instructions renvoyées par github lors de la création du repo)
  <syntaxhighlight lang="bash"> git remote add origin git@github.com:lvaudor/nom_repo.git </syntaxhighlight>
 
Ensuite, créer une branche 'main' (suivre les instructions renvoyées par github lors de la création du repo)


== Premier commit/push ==
== Premier commit/push ==
Ces étapes peuvent ensuite se faire soit en ligne de commandes:


Ces étapes peuvent ensuite se faire soit en ligne de commandes:
 
On indique quels fichiers ajouter à l'archive distante (ici, tous):
<syntaxhighlight lang="bash"> git add . </syntaxhighlight>
<syntaxhighlight lang="bash"> git add . </syntaxhighlight>
<syntaxhighlight lang="bash"> git commit -m "message de commit" </syntaxhighlight>
<syntaxhighlight lang="bash"> git push -u origin main </syntaxhighlight>
<syntaxhighlight lang="bash"> git push -u origin main </syntaxhighlight>


Ligne 23 : Ligne 27 :
https://docs.github.com/fr/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
https://docs.github.com/fr/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account


== Généralités git ==
Récupérer l'url de l'origine:
<syntaxhighlight lang="bash"> git remote -v </syntaxhighlight>
Changer l'url de l'origine de https à ssh:
<syntaxhighlight lang="bash">git remote set-url origin git@github.com:USERNAME/REPOSITORY.git </syntaxhighlight>


== Références==
== Références==


Long tutoriel de git pour les utilisateurs de R par Jenny Brian: https://happygitwithr.com
Long tutoriel de git pour les utilisateurs de R par Jenny Brian: https://happygitwithr.com