-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_setup
More file actions
59 lines (40 loc) · 1.38 KB
/
git_setup
File metadata and controls
59 lines (40 loc) · 1.38 KB
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
50
51
52
53
54
55
56
57
58
### ssh set up`
# Generate an SSH cert for connecting to Github
ssh-keygen -t rsa -b 4096 -C "<email>"
# Check if the ssh agent is running
eval "$(ssh-agent -s)"
# Add the key to the ssh agent
ssh-add ~/.ssh/id_rsa
# Export the public key so you can add it to github
cat ~/.ssh/id_rsa.pub
# Test the SSH connectivity
ssh -T [email protected]
### git local set up
# Set your identity for the repository
git config --global user.name "<user>"
git config --global user.email "<email>"
# Initialize the local git repo
git init test
# Go into the project and add project files
cd test
echo "do something today" >> testfile
# Add the new file to the local git repo
git add testfile
# Commit the project checkout changes
git commit -m "Commit notes"
### git remote set up
# Display remotes
git remote -v
# This URI can be found on the repo page next to the protocol selection
# Add an HTTPS remote git repo by name (This did not work for me)
# git remote add test https://github.com/Mr-H/test.git
# Add a SSH remote git repo by name
git remote add test ssh://[email protected]/Mr-H/test.git
# Create the new repository on github using the +
git fetch test
# If there are items in the remote repo pull them before pushing the changes.
git pull test master
# Checkout the branch (Already checked out)
# git checkout master
# Push the changes to remote git repo by name and branch
git push test master