Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Notebook

Programming notes, instructions, commands, snippets, etc.

Table of Contents

  1. MongoDB
  2. Git

Install MongoDB As A Service In Windows

  1. Download MongoDB from https://www.mongodb.org/

  2. Extract the contents of the zip file into C:\mongodb

  3. Add MongoDB to the Windows path. Edit your environment variable. Append this: C:\mongodb\bin;

  4. Create a configuration file C:\mongodb\mongod.conf and add these lines:

dbpath=C:\mongodb\data\db
logpath=C:\mongodb\log\mongo.log
verbose=vvvvv

Note: you have to manually create both c:\mongodb\data\db and c:\mongodb\log directory.

  1. Open the command prompt as administrator and run the following commands:
mongod -f c:\mongodb\mongod.conf
mongod -f c:\mongodb\mongod.conf --install
  1. Start MongoDB
net start mongodb

From now on, mongodb service will run automatically every time the PC is restarted.

Environment Configurations

$ git config --global user.name "<your_name>"
$ git config --global user.email "<your_email>"
$ git config --global core.editor "<e.g vim>"
$ git config --global core.ignorecase false

Generate SSH Key

$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

# Copy SSH key into the clipboard
# For Windows: $ clip < ~/.ssh/id_rsa.pub
# For Linux: $ xclip -sel clip < ~/.ssh/id_rsa.pub
# For OSX: $ pbcopy < ~/.ssh/id_rsa.pub

Repository

# Adding a remote
git remote add origin <remote_url>

#Updating a remote
git remote set-url origin <remote_url>

# Determine the URL that a local git repo cloned from
git remote show origin

Branch

# Create a new branch and checkout
git checkout -b <branch_name>

#Delete a branch from local
git branch -d <branch_name>

#Delete a branch from the remote origin
git push origin --delete <branch_name>

#Throw away local commits in Git
git reset --hard origin/<branch_name>

# Going back to an old commit (rewrites history)
git checkout <branch_name>
git reset --hard <destination_commit_hash>
git push origin <branch_name> --force

Tag

# Adding & pushing a tag
git tag -a <tag_name> -m "<message>"
git push origin <tag_name>

# Deleting a tag
git tag -d <tag_name>
git push origin :refs/tags/<tag_name>

Commit

# Discard all commits made after a certain commit
$ git reset --hard <commit>

Log

# History of a moved file
git log --follow <file_name>

# Show Log Graph
git log --oneline --graph
git reflog

License

The MIT License Copyright © 2016 Shibbir Ahmed

About

Web development related notes, instructions, commands etc.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors