
When prompted, select Push an existing local repository to GitHub and. I'm really confused I couldn't find a good answer online, as I believe this must be the second most common use case (after creating both a new DevOps project and a new VS project at the same time). To create a repository for your project on GitHub, use the gh repo create subcommand. git init - get the files from stock repo.

There should be a straightforward, obvious way to do it. What Im trying to do at the moment is git init to create a new repository, and then grab the files from my existing repo, either using clone or subtree (Ive not got my head fully around this yet so may be barking up the wrong tree), and then add, commit, and then push these to my new repository. Create a new "MyApp" repository from Visual Studio
Git push files to new repository code#
To save the code in a remote repository you need to push your commits.

This will create a new commit to save changes locally. Create a second repository "Dummy" there, because there must be at least one hover the files you want to add and press the + button (2) When you are done adding, commit your work pressing on the v (3) and then add a message on the text box (4) and press enter. git remote -v (no idea what thats suppose to do. You can choose to either initialize a README or not.
Git push files to new repository free#
git remote add origin remote repository URL ->the repository I want to add the local file/folder to. Prerequisites To initialize the repo and push it to GitHub you’ll need: A free GitHub Account git installed on your local machine Step 1 Create a new GitHub Repo Sign in to GitHub and create a new empty repo. git add (name folder or file I want to add to the github repository) git commit -m ''. So I don't really need to create a new repository, but just connect to the existing one, so I can push the project there. (using command line): Initialize the local directory as a Git repository ->git init. However, when I use "Create Git Repository", it won't let me create the repository with the same name, since it already exists, because DevOps automatically creates a repository with the same name for a new project: This should be a very common problem, I guess. Now from Visual Studio 2022 I want to push my project into the DevOps repository. Then git add myproject/ to stage its contents. I have an existing Visual Studio project with existing codeĪnd a newly created Azure DevOps (git) project with an empty repository. You need to git add myproject to stage your new folder.
