-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithubNotes.txt
44 lines (25 loc) · 2.07 KB
/
githubNotes.txt
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
Generating a new SSH key and adding it to the ssh-agent in order to add a new machine to Github:
Refer to the link https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Note that in the ssh-add stage, you need to omit the ".pub" extension of the file you provide.
Since git changed master to main, when one tries to push to their "master", they get
errors claiming master and main have entirely different histories. To fix this
problem do the following:
git checkout master
git branch main master -f
git checkout main
git push origin main -f
Ref: https://stackoverflow.com/questions/23344320/there-isnt-anything-to-compare-nothing-to-compare-branches-are-entirely-diffe
1. In the command line, navigate to the root directory of your project.
2. Initialize the local directory as a Git repository.
git init -b main
3. To create a repository for your project on GitHub, use the gh repo create subcommand. Replace project-name with the desired name for your repository. If you want your project to belong to an organization instead of to your user account, specify the organization name and project name with organization-name/project-name.
gh repo create project-name
Follow the interactive prompts. Alternatively, you can specify arguments to skip these prompts. For more information about possible arguments, see the GitHub CLI manual.
If gh is not present, set the remote using the git remote command like this:
git remote add origin git@github.com:lottaquestions/regex-hs.git
4. Pull changes from the new repository that you created. (If you created a .gitignore or LICENSE file in the previous step, this will pull those changes to your local directory.)
git pull --set-upstream origin main
5. Stage, commit, and push all of the files in your project.
git add . && git commit -m "initial commit" && git push
Ref:
https://docs.github.com/en/github/importing-your-projects-to-github/importing-source-code-to-github/adding-an-existing-project-to-github-using-the-command-line