Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to push to git from Terminal / Command Line

I added a file into the folder for Git uploading. I can see the folder in the SourceTree under unstaged. How can I push the file to online storage with terminal commands?

I figured it out I need to first cd to the local repository, which I did with this:

cd /Users/mainuser/Desktop/Projects
git add -A .

checked status with git status and it outputs this:

On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    new file:   ios_projects/2016/Untitled copy 2.rtf // this is the file I want to upload

What now? How do I commit it and push it online?

like image 467
sanjihan Avatar asked Apr 27 '16 12:04

sanjihan


1 Answers

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'
like image 85
Shani Avatar answered Oct 20 '22 19:10

Shani