Skip to content

Instantly share code, notes, and snippets.

@nikkaroraa
Created May 27, 2018 16:28
Show Gist options
  • Save nikkaroraa/4f2fb4ac23e056ffed56eda1175e2962 to your computer and use it in GitHub Desktop.
Save nikkaroraa/4f2fb4ac23e056ffed56eda1175e2962 to your computer and use it in GitHub Desktop.
GIT Notes

Starting a New Project

  1. Login to your GitHub account and create a new repository.
  2. Copy the generated URL which looks something like this: https://github.com/iamoperand/test123.git
  3. Now, create a new folder in your system.
  4. Open terminal in that location and then follow the following commands:
git init //to initialise GIT in the target location
git add --all //to add all the files (staging is what it means, done just before committing)
git commit -m "Write your commit message"
  1. Now is the time to link both the project that you have in your system to the online repository that you created in GitHub.
git remote add <nick name> <copied URL which you got from step 2> //origin is used as a nickname as default

Example: git remote add origin https://github.com/iamoperand/test123.git

  1. Now, that you have created a link between both the repositories i.e. the local and GitHub one, we will push our local code to the online GitHub repo.
git push <nick name> <branch name> //master is the default branch name

Example: git push origin master

  1. You are all set. Now just open the respective GitHub URL and see your pushed code online :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment