Skip to content

Instantly share code, notes, and snippets.

@shov
Last active November 6, 2018 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shov/00fe1cdeb7f232ca3a5db16b5b337035 to your computer and use it in GitHub Desktop.
Save shov/00fe1cdeb7f232ca3a5db16b5b337035 to your computer and use it in GitHub Desktop.
git routine

New empty repository started on github

  1. Go github, create new repo
  2. Copy ssh/https link
  3. Go to your project folder 4.git clone <paste link here> and all project will be downloaded to new folder with same name as project is
  4. Or you can set name of this folder git clone <paste link here> newfolder

New repository from existing project

  1. Go your project folders
  2. Make new folder, like mkdir ./myNewProject
  3. Go into, like cd ./myNewProject
  4. Create git repo for this folder git init
  5. Make your files, commits, etc
  6. Go github, create new repo
  7. Copy ssh/https link
  8. Run in this folder git remote add origin <paste link here>
  9. Push everything to the repo git push origin master

I've made some new files / changes

  1. Add all you made to be commited: git add .
  2. Commit it: git commit -m "New feature has been made, and some bugs fixed"
  3. Push to a repo: git push origin master

I've made a bullshit, how I can rollback?

  • git stash hide all of changes in stash - actually just trick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment