- clone: git clone [email protected]host:username/repo.git
- Commit all changes: git commit . -m “message"
- Add all files, including untracked files:
git add -A
- Change message of last commit: git commit –amend -m “message"
- create: git checkout -b new-branch
Merge and Rebase
Merge = create commit from two parallel tracks of changes; Rebase = Act like changes happened in sequence. Merging is usually faster and works in all situations, but rebase makes the commit history look nicer.
- ssh user@host
- Cope to remote: scp local/file/path.ext user@host:remote/file/path.ext
- Cope from remote: scp user@host:remote/file/path.extlocal/file/path.ext
- Exiting VIM: [ESC]:q![enter]
Public key authentication
- More secure and less tedious than password authentication (only one password to remember)
- generate key:
- copy key to host: ssh-copy-id user@host
If you are using public key authentication and don't like typing passwords, add this at the end of your
/.profile` (on the client):
Next, add into your
~/.ssh/config (create it if it does not exist):
If you wish to use the same key on the remote (for example, with git), also add this: