Skip to content

Instantly share code, notes, and snippets.

@sambhav2612
Created November 13, 2017 08:39
Show Gist options
  • Save sambhav2612/561144470384d95c156ea8b7fbb73026 to your computer and use it in GitHub Desktop.
Save sambhav2612/561144470384d95c156ea8b7fbb73026 to your computer and use it in GitHub Desktop.
Pushing to Github
  1. install git on your machine
  2. signup on github.com, get a username and remember your password
  3. make a repository on github.com
  4. get the push link to repo (must end with .git ex)
  5. go to terminal, and to the folder from where you want to upload your files
  6. run command : git init
  7. this will create a empty local repo in your local space (in pwd)
  8. now write command:
git pull THE-LINK-YOU-COPIED-FROM-STEP-4.git master

for example:

git pull https://github.com/sambhav2612/golang.git master
  1. this command will import everything from your remote repo (github) and branch master on the repo tree to your local machine (terminal git)
  2. now add all your files using: git add . -f
  3. wait for all files to be compressed and added, then commit your changes: git commit -m "YOUR-COMMIT-MESSAGE". commit message is the brief description for the changes you made now. commit is nothing but a staging process where your changes to the remote repo (github) are aligned to be pushed online (^_^ )
  4. now that you have commited your changes, wirte this command to push them to your github repo:
git push THE-LINK-YOU-COPIED-FROM-STEP-4.git master

for example:

git push https://github.com/sambhav2612/golang.git master
  1. wait for the commit message, and you are done. refresh your browser tab tp see your changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment