Performing git commit and git push programmatically #24
ernestguevarra
started this conversation in
Tutorials
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@OxfordIHTM/class-2024
For most of you, your workflow for committing and pushing is via the graphical user interface (GUI) of RStudio (on the upper right hand panel git tab).
For a special subset of your class, this is not the possible for them at the moment because for some reason, the authentication between RStudio and GitHub is not working and they are not able to use this GUI to commit and push to GitHub. I am still figuring out why this is the case but for now, this special group in your class is performing Terminal git command to perform commit and push to GitHub.
I thought it would be good to share this to the whole class so that you can try it out and that you get familiar with issuing commands on the terminal.
Important to note that these commands should be run on the Terminal. This is usually the second tab on your lower left panel of RStuido (beside the R console tab). These commands will not work if you run it on the R console.
Following are the commands to issue on Terminal to programmatically commit and push your work to GitHub:
1. Identify the files you want to commit
git add .
This command performs the same action as ticking the box beside the files that you want to commit when using the R Studio GUI.
2. Commit the changes
git commit -m "YOUR COMMIT MESSAGE"
This command performs the same action as clicking on the commit button and then typing a commit message when using the RStudio GUI.
Please note that you should replace the YOUR COMMIT MESSAGE text to the commit message that you want to use for the commit
3. Push the changes
This command performs the same action as clicking on the push button when using the RStudio GUI.
Beta Was this translation helpful? Give feedback.
All reactions