next thing would be to commit using and then push to what ever branch you want to push
git commit -m 'Some message about the change'
git push origin 'branch-name'
Answer from Shani on Stack OverflowHey, Iโm a new software developer looking to build a portfolio. When pushing to GitHub via the terminal, am I supposed to push the root folder of my project onto the repository? Or is it specific files or sub folders? Are there any best practices for having a presentable repository? And lastly, what do I add in the ReadMe file?
how to push to git from Terminal / Command Line - Stack Overflow
github - How to push my changes back to the source code in git - Stack Overflow
Pushing to GitHub via the terminal
How do I push to GitHub from command line without using Github login on the prompt?
You want to connect via ssh key, cf https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/connecting-to-github-with-ssh
Edit the url attribute of the [remote "origin"] section in your repository .git/config file to switch the connection protocol.
Videos
next thing would be to commit using and then push to what ever branch you want to push
git commit -m 'Some message about the change'
git push origin 'branch-name'
Turns out it is that simple:
cd /Users/mainuser/Desktop/YourFolder
git add -A .
git commit -m 'commit message from terminal'
git push
Edit: if you use just git commit without -m, you will enter some editor to type commit message, which I don't know how to quit.
- How to commit my changes to the local git repository as well as my forked repository in github?
To add files changes for commit, use the following command.
git add .
then, make a local commit by
git commit
once you make your local commit, you can then push it to your remote GitHub fork.
git push
- How will the author of the original source code, pull my changes from the forked repository in github
To make your source code pulled by original fork, you have to send a pull request to the project owner.
- Go to the web page of your forked project on GitHub.
- Hit the pull request button on the top right of page
- Select the commits that you want to submit by change commits button.
- Write some description of your changes, comments, or etc.
- Send pull request and wait for the owner reply.
- Here's the simple way :
- git add .
- git commit -m "Final Changes"
- git remote add origin url(in url add the address of your repository)
- git remote -v
- git push -f
- git push origin master