What does Sync Do in Team Explorer? - tfs

I am currently in a project that uses TFS Git as the code repository. In Visual Studio, under Team Explorer -> Sync, there is an option called Sync. Now I am familiar with the Fetch, Pull, and Push actions but Sync is new to me.
Any ideas what this does behind the scenes?

Git in Visual Studio, VSTS, and TFS is standard Git. Although Sync isn’t a Git command, some GUI environments provide a sync button to both update your local files and push your local changes to your remote (your hosted repository).
The Sync button is available on the Team Explorer pane and and
also displayed after you create a commit using the extension. The
sync tool enables you to select how you want to update the project:
sync: performs a git pull and a git push.
fetch: performs a git fetch which retrieves any commits on from your remote without merging them.
pull: performs a git pull.
push: performs a git push.
You can also navigate to the Synchronization view from the Changes view by choosing Sync immediately after making a commit.

Sync is a combination of a Pull Command followed by a Push command. It will 1st perform a Pull, and if there are no conflicts, will then Push the current branch. It is meant as a quick way to just get your current branch into sync with the remote branch.

Related

XCode and Github

I'm trying to use git on an existing Xcode project by making a remote repo, but I can't push to it. I get this error: "The remote repository rejected commits. Make sure you have permission to push to the remote repository and try again." . I'm unsure why git makes the remote repo, but does not allow me to push. Could it be that my Xcode project is too large for the initial push?
The problem shouldn't be that your Xcode project is too large. You most likely are not allowed to push on the "master" branch because it is a protected branch. Is this your own remote repo or is someone else the owner?
If you want to push to the remote repo immediately, you can create your own branch off of master (if you are currently in the master branch) with
git checkout -b <branch_name>
To learn more about GitHub protected branches, check out GitHub Protected Branches

jenkins doesn't generate the build automatically using local git repository

In my system i am using local git repository and jenkins server,I clone the bitbucket repository into my local git repository and perform all the operations it does well.
I would like to generate the bulids automatically whenever there is push is going from local git to bitbucket for that i give the git repository url in the source code management and mark the build trigger `when a change is pushed to bitbucket
Later i apply and press save.
Now I did some modifications in local git and pushed it also,it is successfully pushed and data is updated in bitbucket also but in jenkins there is no build
can any one please help to me.
If you do not want to poll, you must configure BitBucket to notify your Jenkins when something happens. These are called "hooks". You can read about them at https://confluence.atlassian.com/display/BITBUCKET/Manage+Bitbucket+hooks and there is a whole section on how to configure a hook for Jenkins.

jenkins doesn't generate the builds automatically using local git repository

In my system i create a local git repository and i clone the bitbucket central repository and perform all the operation well.
Now i am trying to generate build automatically whenever there is a push is from local git repository to bitbucket repository for that i download the git plugin and installed in the jenkins and i provide my local git repository address as the source code management and i marked the build trigger "Build when a change is pushed to BitBucket".
But it doesn't generate the builds automatically if i click manually "build now" button then it generates.
can you please hemp to me.
You have to configure a hook in Bitbucket so it can tell Jenkins when someone pushed new code.
Have you tried following this tutorial:
https://confluence.atlassian.com/display/BITBUCKET/Jenkins+hook+management
Sometimes "Build when a change is pushed to BitBucket" doesn't work properly. Rather than use Polling to bitbucket every minute
You have to write 5 * symbol separate by spaces.

Apply branches on multiple repositories

I have a Rails app A and I cloned a Rails app B from it. Both have a separate Git repository for version control. Now I develop new features in separate feature branches which are then applied to either app A or app B.
But I also have feature or bug branches which need to be applied to both apps. Let's suppose I created a feature branch on app A and I want to apply this feature branch also to app B, how would I achieve this? Both git repo's are on my local machine and also on Github.
You can add a new remote on B.
git remote add A <url of A>
Now you can pull in changes from A by running the following on B local:
git fetch A feature
git checkout -b feature A/feature
All you have to remember is to keep any changes which you want to share on a separate branch. Now suppose you got some undesirable changes on this branch which you do not want to merge. You can always cherry pick individual commits on top of your current branch (master?)
git co master
git cherry-pick <hash of commit>
You can read more about it here: http://wiki.koha-community.org/wiki/Using_Git_Cherry_Pick

Is there a way I can view changes committed to my local GitHub branch without having to push it to the master branch?

I'm still figuring GitHub and Heroku out, so please bear with me. :)
I've a web app on, say, xyz.com. What I am doing now is to make some code/UI changes on some files, commit those files, push them to the master branch, and then refreshing the url to see these changes.
I think this is obviously the wrong approach, but I don't know of how else to test changes done to my code without having to push them on to the master branch. How could I do so?
I don't quite understand the situation in the full version of your question (see my comment and, as icc asks, why can't you test locally?), but to answer the question in the title, you can see the differences between your master and the version on GitHub by running:
git fetch github
git diff github/master master
(That's assuming that the remote that refers to your GitHub repository is called github - it might well be origin in your case. You can see all your remotes with git remote -v.)
To explain that a little further, when you run git fetch github, git will update all your so-called "remote-tracking branches" - in most cases those are the ones that look like origin/whatever, github/experiment, etc. Those are like a cache of the state of those branches, and they're only updated when you run git fetch or successfully git push to that branch on the remote repository. So, once you've done this to make sure that github/master is a recent snapshot of that branch on GitHub, you can happily compare it with your local master branch using git diff.
First: You don't push to the master branch, you push to a remote repo. You should probably read up on your git.
Second: This is not a good workflow, first you should commit your changes and then test them locally. When you are done testing you are ready to push your commits to a remote repo.

Resources