How to keep updating azure repo from Git Hub? - azure-devops

I have my repo in GitHub. When I first use Azure repo, I clone that GitHub repo in to Azure repo.
Now, I make some changes in my local machine using git. After that I commit a code in git master branch. Then I did git push to my GitHub master branch. I can see a commit id with comment on GitHub. But some how I am not able to see a that commit in Azure Repo.
Does anyone have any suggestions?
My repo is a private repo, so I sync it to Azure Repo with my credentials.

Related

Azure Devops Migrate from TFVC to Git

I try to migrate from tfvc to git like the picture1.
but nothing comes into git repository like the picture2.
We can reproduce this issue and we have reported this issue, you could refer to this ticket to get the latest news.
As a workaround, we could migrate the TFVC repo to Git via git cmd.
let’s follow the migration guide and execute the clone command:
git tfs clone {TFVC repo URL}
Get all branches:
git tfs branch –init --all
For each branch, run these commands:
git checkout branch
git log -1
git tfs pull -c=changesetNumber
Create a new repo in the azure devops and get the repo URL. Then setup the git repository upstream:
git remote add origin {New repo URL}
Finally you push all your local changes to the Remote.
git push origin -u -all
We could refer to MIGRATING FROM TFVC TO GIT and Migrate From TFVC To Git for more details.
Update1
According to the latest news: A fix for this issue has been prepared. We’ll update you when it’s available.

How to open a pull request on github for an improvement in a bitbucket fork?

I cloned a github repository into our Bitbucket account. Similar to https://gist.github.com/sangeeths/9467061.
I fixed a bug in my repository located in bitbucket. I'd like to open a pull request on the original github repository that fixes the bug.
If my fork were located on github, I would simply follow these instructions, but since my fork is on bitbucket, I don't know where to start.
How can I open a pull request from my bitbucket repo to the original github repo ?
You can:
clone the original GitHub repository to a different folder
add your local BitBucket repo as a remote
fetch your fix branch (make sure you fix is done in its own branch, not master)
create a PR using the cli/cli GitHub command line interface gh pr create
That is:
git clone https://github.com/original/repo
cd repo
git remote add bb ../yourLocalBitbucket/repo
git fetch bb
git checkout bb/fix
gh pr create
The gh pr create command will do the work for you:
When the current branch isn’t fully pushed to a git remote, a prompt will ask where to push the branch and offer an option to fork the base repository.

"Disconnect" forked Git repos in VSTS

In VSTS, I forked a repository to develop a separate product from the original repo.
When I make a PR from a branch into master in my forked repo, VSTS defaults to merging into the original repo. I have to be sure not to mistakenly merge into the original repo with every PR.
VSTS seems to think that I may want to merge changes from my forked repo into the original one. I have no plans to do so. How do tell VSTS to 'disconnect' my forked repo from the original?
No, there isn’t such feature in VSTS, there is the user voice that you can vote: Allow option of converting forks to repos
Work-around
As a work-around (in Visual Studio) until it's fixed:
Pull the repo.
Delete the remote repo.
Create a new remote repo with the same name.
Push the repo.
You might have to create a temporary remote repo (named temp if you'd like) in order to be able to delete the remote repo. You can delete the temporary remote repo, named "temp", after you've pushed to the new remote repo.
You'll most-likely break anything (pull requests, work items) linked to the repo and also have to re-apply any policies and security stuff.
repo = the faulty fork in VSTS.
temporary remote repo = a temporary tepo created if you cant delete the fork repo.
new remote repo = the new repo to be used instead of the fork.
It seems like one should disconnect the old remote origin and set the upstream before pushing. Maybe the push with the --set-upstream overwrites that?
Here's what I'm did:
git clone ACCOUNT#vs-ssh.visualstudio.com:v3/ACCOUNT/PROJECT/FORK-NAME NEW-NAME
git remote rm origin
Create the new repository on VSTS for NEW-NAME
git push --set-upstream ACCOUNT#vs-ssh.visualstudio.com:v3/ACCOUNT/PROJECT/NEW-NAME develop
This worked for me to change from a fork to a repo. I can see the full history and open changesets from the web viewer. I did this in Azure DevOps (formerly Visual Studio Team Services AKA VSTS). I did not test against GitHub.
Pull requests and pushes are lost. Commits are still linked
I'm not sure if you need to do the push multiple times for different branches. My fork only has a develop branch anyway. I only create a master branch so git flow doesn't complain.

Commit in github repo branch

I finished coding a website in my local computer. Now need upload it to one branch github repo. like https://github.com/xxxx/test.git branch 001
Can you tell me how to commit it in the repo branch
I have already create a local repo commit all files into it by Netbeans. So How can i push the local repo to remote repo branch?
Thanks
When you locally create a branch Git automatically takes care of creating a new branch on the remote server. Just normally do
git push
It will create the branch on the remote server.

How to locally update repository from github

If I cloned a github repository with the follwoing command:
git clone - git://github.com/user/project.git
And then the developer commits further changes (to the main branch) how can I get the latest changes locally?
git pull
Also check out this resoruce for a visual representation of the git commands.
A git pull will retrieve the changes from the main branch to your local repository