Book Image

Git Best Practices Guide

By : PIDOUX Eric
Book Image

Git Best Practices Guide

By: PIDOUX Eric

Overview of this book

Table of Contents (12 chapters)

Pushing data on remote repositories – Jim's case


So, Jim initializes a new Git repository in the directory, where he starts coding, and he adds the remote repository with the SSH protocol. He has to commit and push what he coded earlier. This is how he did it:

Jim@local:~/webproject$ git add .
Jim@local:~/webproject$ git commit -m 'add my code'
[master (commit racine) 83fcc8a] add my code
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 index.html
create mode 100644 readme.txt
Jim@local:~/webproject$ git push –u origin master
Counting objects: 3, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 225 bytes | 0 byte/s, done.
Total 3 (delta 0), reused 0 (delta 0)

Now, the remote repository contains two files (index.html and readme.txt).