-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-started-github.txt
More file actions
49 lines (25 loc) · 903 Bytes
/
get-started-github.txt
File metadata and controls
49 lines (25 loc) · 903 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<configure user email address and user name>:
git config --global user.email "[email address]"
git config --global user.name "[name]"
<configure default initial branch>
git config --global init.defaultBranch main
<configure push default option>
git config --global push.default current
<configure credential helper>:
git config --global credential.credentialStore cache
git config --global credential.cacheOptions "--timeout [seconds]"
<when you have to enter password, enter the personal access token>
<create a new git repo and push to existing remote repo on the command line>:
git init
git add -A
git commit -m "Initial commit"
git remote add origin [repo address]
git branch -M main
git push -u origin main
<clone an existing repository>:
git clone [repo address]
git push -u
<pull forcely to overwrite>:
git fetch --all
git reset --hard origin/main
git push -u origin main