Sync some projects from Azure Devops to Github or another solution? - github

I have a big .NET solution with many projects. Everything is on Azure devops, and working well for the team.
Some of these projects are demo project.
I would like a way to publish the code of these demo projects on github, so they will be publicly available.
I'm looking for a way to publish the code of these specific projects to github.
Does anyone have a way to do that efficiently ?

if you are using any previous source control (ex TFS) first Unattache it ,
i presume you are using VS,
right click the solution then select "Add solution to source control "
since VS 2015 , GitHub is integrated out of the box , log in to your GitHub account(if you are using an older version just download it as an extension )
Below are the visuals

Create a new folder.
Copy to this folder only the projects you want to publish on GitHub.
Create a new Git repo:
git init
git add .
git commit -m "first commit"
Create a new repo on GitHub:
Open cmd and push the new local repo to new GitHub repo.
cd path/to/your-new-folder
git remote add origin https://github.com/{your-user-name}/demo-projcets.git
git push -u origin master

Related

connect to azure devops repo - locally existing solution

I have an existing visual studio solution which was cloned from a git repo (in azure devops). I recently reinstalled windows and vidual studio 2019. The solution is still there in my computer. I just need to connect the same to the repository in devops.
I connected to the azure devops account using team explorer (after opening the solution in visual studio). The connection happened, but the solution files are closed and there is only option to clone the repository (see screenshot)
If I click on "Git changes"/ "Git repository" , it takes me to the git menu which has only option to create or clone repository.
Even without the team explorer, the only git options that I can see are clone or create.
What am I doing wrong?
what is the correct way to connect exiting repo without cloning?
In the toolbar try clicking Git --> Manage Remotes. I'm assuming these are blank due to reinstalling windows. Click add, name it origin and add the clone url from the relevant azure repo for both Fetch and Push.
This can also be done using git bash by CDing into the solution folder and using the following command
git remote add origin [repo-url]

Cancelling Version Control in Xamarin Studio while sharing with Github

initially i was trying to commit a project to github , then accidentally i didn't commit the project well, now am trying to remove Version Control and switch it again to Commit the project to Github.
I want to see this :
But am seeing this :
How can i Commit again , to github?
I recently just had this problem and asked the wonderful people at Github.
Note: I reset up a new repository, to commit to. I deleted the old one I had messed up. But still could not use Xamarin to Publish. Even after changing the remote connection in version control to the new repository.
This was the solution they provided me with:
From Github
I'm not familiar with the tool that your using to push to the repository but I can help you do this via the command line if that works for you?
Once we get the project pushed to GitHub I think should be able to clone it again to a fresh location on your computer and then link this into Xamarin hopefully.
The steps to push this from the command line would be:
Open the Terminal app and change directories to the location of the project on your local computer.
The command to change directories would be cd <full path to the projects location>. For example if your project was located in your documents folder
cd ~/Documents/projectname
Once there, you need to initiate the project for git version control, commit the project and link up the GitHub repository. To do that you can run the following commands one after the other:
git init
git add .
git commit -m `First commit`
git add remote origin https://github.com/yourrepository/project.git
The last step would be pushing to GitHub:
git push origin master
We have a help doc that has some instructions for this below:
https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
Let me know if you run into any trouble with that!
The only thing they did not mention was that you will be prompted for a username and password. This is the username and password for Github (not the token created for the repository)
Also in the linked documentation, in the above they use:
git push -u origin master
as the last step, I got an error when I did not include the -u
I also did not need to clone it.
The remote connection in Xamarin now links to this new repository. I have made and committed some changes to check.

How Do I Push an Existing Eclipse Project Up to Bitbucket With EGIT?

I have a project for an interview I need to get onto Bitbucket. I normally use Github, so the slight change is throwing me off. I coded the project, tested it, and it works fine. Now I want to get it up on the repository, but can't. I installed EGIT to my Eclipse instance on my local, and while it will attach itself to the empty online repository it won't allow me to import my local code to a do a push and commit.
Can anyone advise on the simplest way I can get this taken care of?
With EGit on Neon: right-click on project > Team > Push branch...., you'll see the push dialog and a button to create a new remote. Click this button, configure the bitbucket repo, Finish.
Then the repo should be available in the Push Dialog. So select it as target and press Finish.
In Bitbucket you can import project from github.
But if you want to change git remote origin and send the whole project again to Bitbucket get to this file : .git/config and change the [remote "origin"] section to the Bitbucket repo http or ssh and then:
git add all or git add .
git commit -m "last commit massage ..."
git push -u origin master
I recommand to use Gitlab instead of Bitbucket for private repo.

Synch NetSuite SuiteScript Files with Git Repo

We're trying to use Git source control for our NetSuite SuiteScript. How can I synch my Eclipse SuiteScript workspace files with my local git repo if the local repo already contains the files (meaning "Share Project" won't work)?
I've already setup a Git Repo for our NetSuite SuiteScript library. The initial setup was simple because I pulled down our file cabinet using the SuiteCloud IDE (Eclipse/NetSuite bundle), added an existing local git repo, and used the Eclipse Team > Share Project feature to push the SuiteScript files to the repo. However, that method only works the first time through.
Our other developers aren't able to use the Share Project feature to synch the projects with the Repo since the files already exist in both locations. The challenge is that the files need to be pulled directly from NetSuite first in order to have the necessary indexes for the File Cabinet.
I think you should be able to pull files from file cabinet, do git init , commit files to git repo, and then delete the project from workspace. This would ensure the files exists in netsuite and git repo both.
Now, you can take a similar approach as in the case where files existed in both NetSuite and git repo, by creating new project and pulling up the files again from NetSuite and adding git repo info.
I found a way to do this.
Clone your remote repo (can use init too but easier with clone IMO)
Delete all the files in your repo
Pull all the files into Eclipse from NetSuite.
Use Team > Share Project to synch with your repo
Use fetch to reset to the remote repo
git fetch
git reset --hard origin/master
After this you're all set.

egit for eclipse: How do I put my existing project in the clone of my buddies repo?

My buddy gave me his git address for the project we are going to work on. In Eclipse using egit I cloned his branch.
So now in my Git view I have my own repository I created of an existing project. I want this existing project to be on my buddies branch so we can both check it out and have it in our repo.
Unfortunately I am using Windows to do this because we are developing a game and I do all of the art & animation in addition to programming. I would feel much more comfortable on the cmd line than using this plugin..
Any help is much appreciated!
The notion of repo and branch are quite different.
If you have a clone of our buddy's repo, you can work on a branch named like the one your buddy uses (by default 'master' if he hadn't created any other), and everything you will push will be added/merged to the remote branch in the remote repo.
For more on Egit, see this "Git with Eclipse (EGit) - Tutorial", and check if yuo can push at least one file, that your colleague will be able to pull from the remote repo and see directly in his branch.