Categories
Web Development

Update remote repo with command line using git and github

If you are using git and github to maintain your code here are some quick and short commands to remember.

Create a new repository on the command line

Enter these commands one after the other using your command line tool.

[sourcecode language=”text” wraplines=”true” highlight=””]
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/username/project-name.git
git push -u origin master
[/sourcecode]

Push an existing repository from the command line

This will push or in other words upload you local files to your remote repo.

[sourcecode language=”text” wraplines=”true” highlight=””]
git remote add origin https://github.com/manidf/javascript-enlightenment.git
git push -u origin master
[/sourcecode]

Leave a Reply