Difference between revisions of "Git Cheat Sheet"

From Nearline Storage
Jump to navigation Jump to search
(Created page with "===Create A New Project Repository=== # Go to [https://github.com/new https://github.com/new] and create a new repository (project) # Create a directory on the local workstat...")
 
m
Line 3: Line 3:
 
# Go to [https://github.com/new https://github.com/new] and create a new repository (project)
 
# Go to [https://github.com/new https://github.com/new] and create a new repository (project)
 
# Create a directory on the local workstation and populate it with the source files, then in that directory do:
 
# Create a directory on the local workstation and populate it with the source files, then in that directory do:
## <code>$ git init</code>
+
:: <code>$ git init</code>
## <code>$ git add .</code>
+
:: <code>$ git add .</code>
## <code>$ git commit -m "first commit"</code>
+
:: <code>$ git commit -m "first commit"</code>
## <code>$ git remote add origin git@github.com:dlk3/projectname.git</code>
+
:: <code>$ git remote add origin git@github.com:dlk3/projectname.git</code>
## <code>$ git push -u origin master</code>
+
:: <code>$ git push -u origin master</code>
  
 
===Pull Down Changes Made At Remote Repository===
 
===Pull Down Changes Made At Remote Repository===

Revision as of 22:55, 31 December 2019

Create A New Project Repository

  1. Go to https://github.com/new and create a new repository (project)
  2. Create a directory on the local workstation and populate it with the source files, then in that directory do:
$ git init
$ git add .
$ git commit -m "first commit"
$ git remote add origin git@github.com:dlk3/projectname.git
$ git push -u origin master

Pull Down Changes Made At Remote Repository

$ git pull origin master

Push Local Changes Up To Remote Repository

$ git commit -a -m "Description"
$ git push