-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGitNotes
33 lines (28 loc) · 1.08 KB
/
GitNotes
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
#To create a repo from the commandline
step1: curl -u 'USER' https://api.github.com/user/repos -d '{"name":"REPO"}'
#Remember replace USER with your username and REPO with your repository/application name!
#e.g. to add repo "knowledge"
#curl -u 'varunsharma0286' https://api.github.com/user/repos -d '{"name":"knowledge"}'
#
step2:git init
step3:git add <files_in_repo>
step4:git commit
step5:git remote add origin https://github.com/<user_name>/<repo_name>.git
step6:git push -u origin master
#To store the credentials (this prevents git from asking username/password every time)
git config --global credential.helper cache
#git config credential.helper store
#From gitlab:
cd existing_folder
git init
git remote add origin git@git.flexwin.intranet.flextrade.com:Market_Data/file.git
git add .
git commit -m "Initial commit"
git push -u origin master
#To get all new info from git:
git fetch
#To use vimdiff for viewing diffs:
git config --global diff.tool vimdiff
git config --global difftool.prompt false
git config --global alias.d difftool
git d <Modified_file_name> #This is to view the diff