Skip to content

Instantly share code, notes, and snippets.

@nucleardreamer
Last active August 29, 2015 14:15
Show Gist options
  • Save nucleardreamer/ee1156b6d63fbaaa2f46 to your computer and use it in GitHub Desktop.
Save nucleardreamer/ee1156b6d63fbaaa2f46 to your computer and use it in GitHub Desktop.
// this is just to install git
sudo apt-get install git
// get in there
cd /to/your/project/folder
// this sets up the git folder, which is located in that directory in .git, it keeps track of all your changes and settings
git init
// this adds all changed files to a changeset. nothing happens here except for that you are saying you want to track these changes. the period after add means everything in that directory
git add .
// this creates a commit that will take all those added files and package them up to put into the repository, you can have multiple commits going at the same time if you want to. the -m gives it a message so you know what changes you made.
// a good commit message is so you can remember what the fuck the general idea was when you checked in files
git commit -m 'initial commit'
// this adds a remote to git, which means it points to the actual repo. at any time, you can type git remote -v to see all the remotes you have, if there is more than one. we add 'origin' so that this is the default repo
git remote add origin https://github.com/nucleardreamer/powerpi.git
// this will push all commits into the repo, adding tracking (this is only done the first time). we specify that we want to push to the master branch on origin (our default)
git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment