Push tags with Xcode 9 - xcode

From cli I push tags like this
git tag 1.0.1 && git push origin 1.0.1
From Xcode 9 I can tag commits. But, how do I push that tag to origin from Xcode?

As of Xcode 10.0 beta (10L176w) (released 2018-06-04, coincident with WWDC18), we can now optionally push tags to the remote during normal push actions. (Source Control -> Push...) There does not, however, appear to be a mechanism to selectively push tags.
Historical Info
As of Xcode 9.1 (9B55), this is currently impossible. I'm certain it will be fixed in an update (though it doesn't exist in Xcode 9.2b2).
As an aside, if you have made several tags and want to push all of them to the remote from the command-line, you can do git push origin --tags.
Update 2018-04: pushing tags still unimplemented as of Xcode 9.3 (9E145)
Update 2018-05: unimplemented as of Xcode 9.4 (9F1027a)
To my further surprise, setting git config --global push.followTags true, which causes all reachable and annotated tags to be pushed when performing git push, has no effect from within Xcode. (Info on push.followTags)
Update 2018-06: The release notes for today's Xcode 10 beta include this quite satisfying entry:
Tags can optionally be pushed from the push sheet. (40141815)
😊
I'm downloading it now and will confirm once it is installed.

Tag name should start with an alphabet. For example, v1.0.1. Then it will reflect in the remote repository.

Related

Xcode bot does not see repository branches

After updating the XCode to version 11.4 (11E146), I stopped seeing repository branches in the bot settings. But I see these repository branches in Source Controll Navigator. Does anyone know how I can fix it?
This issue was resolved in Xcode 12.
OLD answer & workaround for Xcode 11.4 - 11.x:
Unfortunately it's a known issue in the Xcode 11.4 release. https://developer.apple.com/documentation/xcode_release_notes/xcode_11_4_release_notes
Find this Stack Overflow answer to change the branch manually via the Xcode Server API: https://stackoverflow.com/a/42573925/1372065
Looks like this is fixed in XCode12, In case you still need to use XcodeServer on Xcode 11.4 - 11.5 then follow the below steps
In the final step, add a pre-integration script and add the below git commands
git pull
git checkout `your-branch-under-test`
git branch

git - Switching to a local develop, then back to feature branch resets the status of modified/added files

I added some changes in my feature branch, staged, committed and pushed it to origin using push -u git command.
Next day, I updated my local develop and feature branches to get latest code from remote using standard git fetch / git merge procedures.
At this point, I am seeing some interesting things:
I am on my feature branch, git status tells me all is clean, this is correct
I switch to develop branch, git status shows all is clean, this is correct
I switch back to my feature branch, git status reports all my changes that I already pushed to remote day before as follows:
STAGED (GREEN) - My changed are being removed (which marks some files as being ready to commit). The existing files are marked as modified and my changes are removed from them. The files I added are marked as deleted,
NOT STAGED (PURPLE) - The existing project files I modified as part of my push,
UNTRACKED (RED) - The new files I added to the project as part of my push above.
I dont understand why is this happening but it should not.
If I issue git add ., no message shows in git, I am just back to the terminal command.
If I issue now git status, it now shows that my feature branch is uptodate "nothing to commit, working tree is clean".
Switching back and forth from feature to develop and develop to feature branches like described above on my Mac reproduces same problem over and over. Doing so on my Windows machine is not reproducing this issue at all.
So, my conclusion is that something is wrong with my git environment on my Mac machine.
But then, I also tried getting a brand new clone of my project on my Mac (which now contains my feature branch since I pushed it with all my changes using git push -u command), then tried switching back and forth on that clone between develop and my feature branch and the issue was NOT happening. That made it even more confusing.
It looks like something is not being updated properly with my git on my Mac machine. What could it be and how to investigate this?
We are crossplatform team working on both Mac and Windows. My core.autocrlf is set to input on my Mac and to true on my Windows. I dont know other team members settings for core.autocrlf.
First, make sure git config core.autocrlf is always set to false (on Windows or Mac).
Any EOL conversion you might need should be done in a .gitattributes eol attribute.
Then check your git config -l in your repo on the two platform: a content filter driver could be an example of automatic modification on commit, which might not be declared on the other platform.

How to commit hg repo with GIT submodule which should be read only?

my Hg repo now needs to include a Git submodule (Restkit) as per the advised method in the site wiki.
However, I am not updating the git contents and should only be potentially reading/pulling in changes from the host.
It appears that when I came to make my first push of my main Hg repo it baulked at the Git one asking for a password. I think this may be because its attempting to authenticate against the Git site as well.
My questions are can I arrange this so that the Git repo is read-only(pull) or even static and/or get round the log in issue. Obviously the two different repos have different credentials.
Thanks.
P.S. using Atlassian SourceTree 1.5.3 on OS X 10.8.2, Xcode 4.5.1
I've just re-read this;
2.6. Synchronizing in subrepositories
Subrepos don't automatically track the latest changeset of their sources. Instead, they are updated to the changeset that corresponds with the changeset checked out in the top-level changeset. This is so developers always get a consistent set of compatible code and libraries when they update.
Thus, updating subrepos is a manual process. Simply run 'hg pull' and 'hg up' in the target subrepo, test in the top-level repo, then commit in the top-level repo to record the new combination. The onsub extension can be used to automate that.
Assume this means its not pulling the sub? but I still have the above issue of the password request.
You moved in the right direction, but not finished all required steps.
You have to have subrepository, create it by hand... and don't mix real subrepository with a) independent b) nested repository
When you'll convert nested to subrepo push into master repo will not perform push to subrepo (except it requested)

Loading Xcode 4 git repository onto Bitbucket

I have an Xcode project with a few commits, and now I would like to load it onto Bitbucket, without losing my commit history. What would be the best way to do this?
Create a new repository, and push to it from Xcode like normal. It will preserve all of the commit history.
You could follow the Import Code into (BitBucket) repo, and select a Git repo on your local workstation.
The fact that this local repo is managed by XCode4 doesn't matter.
After the import, you can add your Bitbucket repo as a remote, with an https address, as mentioned in "Bitbucket + XCode 4.2 + Git" (even though the XCode GUI might not be enough, and some command lines might be needed).

Understanding Git with XCode and BitBucket

After following several tutorials I was finally able to take my existing, non-Git-Repository XCode Project and get it uploaded to a repository on BitBucket. I'm completely new to git but I'd like to start working with versioning. Since I'm a complete newb I'd rather not be working with the command line all day (which is what I had to do to get the project on BitBucket).
XCode's organizer now has access to the BitBucket repository. I successfully cloned the project back to my hard drive. My question is this: From now on, will the projects be in sync with each other? I'm not familiar with the lingo, and the difference between a branch and a fork. Essentially, I uploaded a 1.0 codebase and I want to start working on 1.1. I'd like to either fork the code or branch it so that the original project remains for reference. From what it appears, when I clone to my hard disk, XCode creates a new local repository instead of saving it on BitBucket.
I'm confused, please help!
Forking is a server-side operation where you clone the repo. For BitBucket, it is generally used with Mercurial (see "Forking a Bitbucket Repository").
This isn't what you have done.
You have simply cloned your BitBucket Git repo (now that BitBucket also support Git, and not just SVN and Mercurial) into a local repo and imported it in your XCode editor.
You can check it through command-line (git remote) or in XCode (See "Version Control System with XCode 4 and Git").
Note that you need to use an https address for your BitBucket clone address for being able to push back to the BitBucket repo from your XCode-managed local repo: see "Bitbucket + XCode 4.2 + Git".
For more on the basis of Git (especially branches), you can follow first the small labs from gitimmersion.com.
What you want to do is Branch your code from your 'master' i.e. your 1.0, to a 'develop' branch i.e. your 1.1 version. This is the simplest way for you to start getting used to version control. Once you create the branch using Xcode, the project in Xcode you are working on locally will be on that branch.
As you make changes to the code on that branch, 'commit' them from Xcode, and then 'Push' them up to Bitbucket (all done from the same menu in Xcode File>Source Control>...Xcode will ask during a push which branch to send changes to so make sure you select your Develop branch.
This will keep your local copy and your remote repo in sync as you develop your code.
This chapter in the Xcode user guide helped me immensely:
https://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/SCM/SCM.html
How often you should do the commit and push dance will come from experience.
Good Luck.

Resources