LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need help with pushing a commit to Git (https://www.linuxquestions.org/questions/linux-newbie-8/need-help-with-pushing-a-commit-to-git-4175659609/)

Cory0127 08-22-2019 12:21 PM

Need help with pushing a commit to Git
 
I am working on a basic python program. I have a git hub page for it and I don't know how to push a commit. I am using the terminal. Any help would be greatly appreciated. Thanks!

rtmistler 08-22-2019 01:23 PM

Here are some command line suggestions:
Code:

$ git status
git add <path/filename>
git add -u
git commit -m "<comment>"
git push
git push origin master
git push origin <branch-name>

Basically you should add new or modified files, these are the git add commands, and there are various options to choose.

Next you commit, using the commit, and typically with a comment.

Finally you push these changes to the repository. I find that typing "git push" first gives me advice back to tell me if I need the origin, etc. Sometimes yes, sometimes no. I don't know the full rules there, sorry, just my experiences.

Hope this helps.

individual 08-22-2019 03:20 PM

Github has a guide explaining how to clone, push, etc. over HTTPS and SSH.
EDIT: To be clear, these instructions are for using Github. Rtmistler provided the steps for using git (which is essentially what Github is a front for).


All times are GMT -5. The time now is 09:01 PM.