-
Notifications
You must be signed in to change notification settings - Fork 0
/
Github setup
37 lines (30 loc) · 907 Bytes
/
Github setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Adding a local repository to remote
git init
git add .
git commit -m "First Commit"
create the repository on github and copy the url
git remote add origin #URL
git remote -v //to confirm the repositories are linked
git push origin master
//to fetch from remote
git clone #URL
git pull origin master
git checkout -- . // discard unstaged changes
//to create a SSH key
use git bash
type ssh-keygen
accept the default location
enter passphrase
cat .ssh/id_rsa.pub
right click on top of cmd windows and edit->mark. then select the text and edit->copy
copy to github-> Settings -> SSH -> new SSH
//change git remote repo
git remote set-url origin #url
//checkout previous commit
git log // to see previous file
git checkout #number
//Use Vim
press a to start typing
press esc. type :wq! to save
// command useful tools
to copy a sentence from cmd, highlight it and press right click at the same time