-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit.sh
More file actions
30 lines (23 loc) · 690 Bytes
/
git.sh
File metadata and controls
30 lines (23 loc) · 690 Bytes
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
# a few git commands as I keep forgetting the syntax
# these commands are used only once to setup ssh
cd ~/.ssh
mkdir ~/sshbackup
mv * ~/sshbackup
ssh-keygen -t rsa -C "gauravdotsaxena@gmail.com"
mkdir newrepo
cd newrepo
touch file.txt
git config --global user.name "gsvolt"
git config --global user.email "gauravdotsaxena@gmail.com"
git init
git add .
git commit -m "message"
# only done once per repo
git remote add origin git@github.com:gsvolt/<repo>.git
# to update remote github repo with latest local commit
git push origin master
# for pulling a remote repo (assuming ssh steps are taken care of):
mkdir folder
cd folder
git init
git pull git@github.com:gsvolt/<repo>.git