LAK-lady / LakeLegacyNP

This project is focused on mining data and tools to quantify legacy nutrient pollution in lakes and their relative contribution to HABs
0 stars 0 forks source link

Remote Git repo not connecting to local Git repo #1

Closed LAK-lady closed 1 year ago

LAK-lady commented 1 year ago

My push/pull buttons on my local Git repo are greyed out. when I work on my Git local repo, I can't push changes to my online github repository. I've googled how to fix this, but don't understand the language used in the resolutions.

LAK-lady commented 1 year ago

I found this article from redgate: A common cause for this issue is that the local repository isn't connected or cannot connect to the remote repository. To resolve this issue, we suggest creating a git-clone from the remote repository to your local environment. Once you've successfully created a git-clone locally, you can then link the database to your local git-clone and should then be able to push/pull to and from the remote repository.

LAK-lady commented 1 year ago

I found this help site from GitHub Docs: https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository About cloning a repository You can clone a repository from GitHub.com to your local computer, or to a codespace, to make it easier to fix merge conflicts, add or remove files, and push larger commits. When you clone a repository, you copy the repository from GitHub.com to your local machine, or to a remote virtual machine when you create a codespace. For more information about cloning to a codespace, see "Creating a codespace for a repository."

Cloning a repository pulls down a full copy of all the repository data that GitHub.com has at that point in time, including all versions of every file and folder for the project. You can push your changes to the remote repository on GitHub.com, or pull other people's changes from GitHub.com. For more information, see "Using Git".

You can clone your existing repository or clone another person's existing repository to contribute to a project.

I don't think I want to clone the repository. I really just need to set or reset the url.

LAK-lady commented 1 year ago

About remote repositories In this article About remote repositories Creating remote repositories Choosing a URL for your remote repository Cloning with HTTPS URLs Cloning with SSH URLs Cloning with GitHub CLI Cloning with Subversion GitHub's collaborative approach to development depends on publishing commits from your local repository to GitHub for other people to view, fetch, and update.

About remote repositories A remote URL is Git's fancy way of saying "the place where your code is stored." That URL could be your repository on GitHub, or another user's fork, or even on a completely different server.

You can only push to two types of URL addresses:

An HTTPS URL like https://github.com/user/repo.git An SSH URL, like git@github.com:user/repo.git Git associates a remote URL with a name, and your default remote is usually called origin.

Creating remote repositories You can use the git remote add command to match a remote URL with a name. For example, you'd type the following in the command line:

git remote add origin This associates the name origin with the REMOTE_URL.

You can use the command git remote set-url to change a remote's URL.

Choosing a URL for your remote repository There are several ways to clone repositories available on GitHub.com.

When you view a repository while signed in to your account, the URLs you can use to clone the project onto your computer are available below the repository details.

For information on setting or changing your remote URL, see "Managing remote repositories."

LAK-lady commented 1 year ago

I tried adding the URL and renaming URL but this didn't work. se ebel C:\Users\lknose\OneDrive - Environmental Protection Agency (EPA)\Profile\Documents\SSWR.405.2.2_LegacyNutrients\Analysis\GitHub\LakeLegacyNP>git remote add https://github.com/LAK-lady/LakeLegacyNP.git usage: git remote add []

-f, --fetch           fetch the remote branches
--tags                import all tags and associated objects when fetching
                      or do not fetch any tag at all (--no-tags)
-t, --track <branch>  branch(es) to track
-m, --master <branch>
                      master branch
--mirror[=(push|fetch)]
                      set up remote as a mirror to push to or fetch from

C:\Users\lknose\OneDrive - Environmental Protection Agency (EPA)\Profile\Documents\SSWR.405.2.2_LegacyNutrients\Analysis\GitHub\LakeLegacyNP>git push github master fatal: 'github' does not appear to be a git repository fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

C:\Users\lknose\OneDrive - Environmental Protection Agency (EPA)\Profile\Documents\SSWR.405.2.2_LegacyNutrients\Analysis\GitHub\LakeLegacyNP>git init Reinitialized existing Git repository in C:/Users/lknose/OneDrive - Environmental Protection Agency (EPA)/Profile/Documents/SSWR.405.2.2_LegacyNutrients/Analysis/GitHub/LakeLegacyNP/.git/

C:\Users\lknose\OneDrive - Environmental Protection Agency (EPA)\Profile\Documents\SSWR.405.2.2_LegacyNutrients\Analysis\GitHub\LakeLegacyNP>git remote add origin https://github.com/LAK-lady/LakeLegacyNP.git The syntax of the command is incorrect.

C:\Users\lknose\OneDrive - Environmental Protection Agency (EPA)\Profile\Documents\SSWR.405.2.2_LegacyNutrients\Analysis\GitHub\LakeLegacyNP>git remote set-url usage: git remote set-url [--push] [] or: git remote set-url --add or: git remote set-url --delete

--push                manipulate push URLs
--add                 add URL
--delete              delete URLs
LAK-lady commented 1 year ago

C:\Users\lknose\OneDrive - Environmental Protection Agency (EPA)\Profile\Documents\SSWR.405.2.2_LegacyNutrients\Analysis\GitHub\LakeLegacyNP>git remote add origin https://github.com/LAK-lady/LakeLegacyNP.git error: remote origin already exists.

C:\Users\lknose\OneDrive - Environmental Protection Agency (EPA)\Profile\Documents\SSWR.405.2.2_LegacyNutrients\Analysis\GitHub\LakeLegacyNP>git push fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use

git push --set-upstream origin master

To have this happen automatically for branches without a tracking upstream, see 'push.autoSetupRemote' in 'git help config'.

C:\Users\lknose\OneDrive - Environmental Protection Agency (EPA)\Profile\Documents\SSWR.405.2.2_LegacyNutrients\Analysis\GitHub\LakeLegacyNP>git push --set-upstream origin master Enumerating objects: 184, done. Counting objects: 100% (184/184), done. Delta compression using up to 8 threads Compressing objects: 100% (181/181), done. Writing objects: 100% (183/183), 4.17 MiB | 2.25 MiB/s, done. Total 183 (delta 69), reused 12 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (69/69), done. remote: remote: Create a pull request for 'master' on GitHub by visiting: remote: https://github.com/LAK-lady/LakeLegacyNP/pull/new/master remote: To https://github.com/LAK-lady/LakeLegacyNP

LAK-lady commented 1 year ago

issue resolved. Push/pull buttons now active again.