Friday, July 11, 2014

Frequently Used Git Command

1. git clone repository_url
Get code from server.

2. git add [.|-A]
Add local changes to be committed

3. git commit -m "msg"
Commit changes with a commit message, code on server is not changed after commit.

4. git fetch
Get the latest code from the server

5. git rebase
Play the latest changes fetched from the server to local code

6. git add . ; git rebase --continue
If there is conflict during git rebase, after solving the conflict, continue to rebase

7. git push
Push local commits to server, code on server is changed after push

Change database port and enable remote access

For Ubuntu system,

MySQL Database:
Change config file
vi /etc/mysql/my.cnf 
1. change 'port' under Basic Setting [mysqld] to the desired port
2. comment out binding address

Run SQL command to enable 'user' access mysql database using 'password' with all privileges:
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY 'password';

MongoDB change port:
Change mongodb config file:
vi /etc/mongodb.conf

Check open ports: sudo netstat -anltp