Articles → AZURE DEVOPS → Import Github Repository In Azure Devops

Import Github Repository In Azure Devops






Steps




  1. Go to project settings.
  2. Go to "GitHub connections".
  3. Picture showing the Github connections menu for setting up the connection of Azure Devops and Github
    Click to Enlarge

  4. A screen will appear on the right side.
  5. Click on the button "Connect your GitHub account".
  6. Picture showing the first screen when clicks on the Github connections menu
    Click to Enlarge

  7. A screen will come where you are authorizing Azure DevOps to access your GitHub account.
  8. Picture showing the authorize screen to access github when user clicks on Connect your GitHub account
    Click to Enlarge

  9. Once you authorize, another screen will come to enter the password.
  10. Picture showing the screen to enter the github password
    Click to Enlarge

  11. Once the user is authenticated, you can see the GitHub repository.
  12. Picture showing the list of repository in the github account
    Click to Enlarge

  13. Click on the "Save" button. Once you click the button, one more screen will come to authorize and install.
  14. Picture showing the screen to authorize the azure boards to access Github repository
    Click to Enlarge

  15. A connection is established.
  16. Picture showing the connection set up between the github repository and Azure Boards
    Click to Enlarge

  17. Import the repository, click on the "Import repository".
  18. Picture showing the import repository option for importing the repository files on the Azure Boards
    Click to Enlarge

  19. A docked window will appear on the right side. Enter the GitHub URL and click on the "Import" button.
  20. Picture showing the screen to import the github repository to the Azure Boards
    Click to Enlarge

  21. The repository will be imported in Azure DevOps.
  22. Picture showing the github repository imported in the Azure Boards
    Click to Enlarge



Perform Operations On Your Local Machine




  1. Click on the "Clone" button.
  2. Picture showing the clone button for clonning the imported repository to the Azure Boards
    Click to Enlarge

  3. A window will appear to show the repository URL.
  4. Picture showing the screen to clone the repository in the Azure Boards
    Click to Enlarge

  5. Open the "Git Bash" application.
  6. Inside the "Git Bash" application, go to the path where you want to clone the repository.
  7. Use the following 2 commands.
  8. cd c:/temp/repo
    git clone https://GSorg21@dev.azure.com/GSorg21/second/_git/myrepo.git


    Picture showing the git bash screen for executing the git clone command
    Click to Enlarge

  9. The files are copied on the local machine.
  10. Picture showing the files downloaded on the local machine after the git clone command is executed on the git bash
    Click to Enlarge

  11. Now, create the file "a.txt" and enter text in it.
  12. Picture showing a new file added in the local folder
    Click to Enlarge

  13. Use the following three commands.
  14. cd myrepo
    git add .
    git commit -m “added a.txt”


    Picture showing the git bash for executing the commit command
    Click to Enlarge

  15. In case you face any issue, you can execute the following commands.
  16. git config --global http.proxy ProxyUrlOrIP.com:8080
    git config --global --unset http.proxy


    Picture showing executing the git config --global http.proxy ProxyUrlOrIP.com:8080 command in git bash
    Click to Enlarge

  17. Perform the git push operation using the following command.
  18. git push 


    Picture showing the execution of git push command
    Click to Enlarge

  19. Changes are pushed to the Azure DevOps repository.
  20. Picture showing the list of commits in the Azure Boards
    Click to Enlarge



Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, May 4, 2021

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250