Giter VIP home page Giter VIP logo

practice's Introduction

This is my first practice repo on github, establishing the workflow with 2 clients (home,work) and the ability to push changes from each to github and pull to each from the server.

How To Setup 2 Machines to share a repo

  • Note: making the new repo gives useful hints.
  • Note: add both starts tracking file and stages files. -a auto stages

Both Machines - SSH

ssh-keygen -C "[email protected]" -t rsa

Note: login to github and add the resulting public keys for each client

Both Machines - git Setup

git config --global user.name "my name"
git config --global user.email "[email protected]"

Note: these can be done locally to without the --global flag

Machine 1

mkdir mydir; cd mydir
git init                 //initialize this repo
git add .                // . recursively adds all the files
git commit -m 'initial'  //commit changes

Now push it: git remote add origin [email protected]:mchampine/practice.git //name online repo "origin" git push origin master //push local master branch to remote origin (on the server)

Machine 2:

git clone [email protected]:mchampine/practice.git  //clone via the private url

Add a file, add it to staging, commit and push it to the server:

vi README
git add README
git commit -m 'added a readme'
git push origin master

Edit a file, stage and commit, push it:

vi README
git commit -a -m 'a comment'  //commit all changes and deletions 
git push origin master   //push to the server

Machine 1:

git pull                      //don't have to specify where
git commit -a -m 'a comment' //commit all changes and deletions git push

Repeat over and over indefinitely...

practice's People

Contributors

mchampine avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.