How to tag a Git repo from Xcode 4 - iphone

It might be silly, but i just can't figure it out:
i added git support for my project after creating it, by closing Xcode and, from terminal:
$ git init
$ git commit -a -m "Initial commit"
When i reopen Xcode, it detects my local repository just fine, except for the fact that i just can't get how to create a tag. I can create a branch, but not a tag. How do you create one from Xcode?
EDIT: Did what #edc1591 suggested, and even created a project with Git support from scratch and i still don't see how to create a tag. There's only a Branch subfolder and the possibility to add one (branch), but nothing about tags...

Xcode 4 doesn't have a way to do a lot of SCM things, but it does cope with you doing most things via the command line (even while it is running). So if you want to make a tag make sure what you want tagged is committed and then do it like you would from the command line:
git tag -a -m "Mostly works" project_v0.2
On the plus side where Xcode 4 does SCM things, it does them pretty well. The "diff view" and blame view are both very useful, as are the status tags.

Make sure you do git add . (from the project directory) after git init. I'm not sure if this will fix the problem though. But based off what you have, you're just making an empty git repo

Related

Github version of Perforce's explicit check-out feature

I've recently moved to Github (VS2017's built-in support) from Perforce for some individual projects. There is a feature in Perforce called "make writable" that allowed you to write to a file locally and then only submit it to the server by explicitly checking it out then submitting it.
This was used extensively for any binary files (.exe, etc) that only needed to be pushed very rarely but still needed to be written to.
Unfortunately from my limited experience with Github, it seems that all files are set to writable and are always marked as "changed", even exes. Is there a setting I can make or setup that allows Github to only mark a file as changed explicitly so I can't accidentally push an incomplete, broken, or debug .exe?
Updated answer: So, I forgot, if the file's tracked by Git at any point, then it gets a bit ugly. There are ways around this, but it isn't a single command to do this.
IF you want to do the .gitignore route, you can. But there's an added step (see below for first step). You have to, after each commit you do of the .exe file, run git rm --cached <filename>. This will remove the metadata around the file telling Git to track it. Once you do that, it won't show up anymore in the Changes list in the Visual Studio plugin (if you're on commandline it won't show up in git status). Then to add a file, you do what I mentioned below, which is to do the git add -f <filename>.
If instead, another way to do this, would be to run git update-index --assume-unchanged <filename>. This tells Git to ignore changes to the file. When you want to commit it, first run git update-index --no-assume-unchange <filename> and do your normal git add git commit workflow, then once you've committed it, run again the git update-index --assume-unchanged <filename> bit. It's messy, and honestly, I'd write a custom tool in VS to do this rather than relying on the built-in SCM tool in Visual Studio.
Original answer: Best way to do this (IMO, others will have their own opinion) is to add the files to your .gitignore. Then if/when you really want to commit them, do a git add -f <file> and then commit as normal.
Edit: Note that this is something everyone will have to do to avoid accidentally committing. A way around that is to commit your .gitignore as well so everyone has the same behavior.

eclipse github desktop ignore error

error: Your local changes to the following files would be overwritten by merge:
adminpage/.metadata/.log
adminpage/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
adminpage/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs
adminpage/.metadata/.plugins/org.eclipse.datatools.sqltools.result/results
adminpage/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
adminpage/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/com.genuitec.eclipse.aeri.server1/server-config.json
adminpage/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/server-config.json
Please commit your changes or stash them before you merge.
Aborting
Use the git hub desktop.
The team members share their performance with a git, and every time they commit it, they are outweighed by the difficulty of printing.
I've tried everything on the Internet, and I've tried to do this, and I've tried to do this, and I've tried to change this, and I'm not going to go through this.
I'm creating a jsp based web source with Eclipse, but I don't know what's wrong with it.
I'd like to get the help of millions of experts here.
If you can, it would be easier to ignore the .metadata/ folder entirely:
git rm --cached -r adminpage/.metadata
echo "adminpage/.metadata/" >> .gitginore
git add .gitignore
git commit -m "remote and ignore adminpage/.metadata"
git push
Repeat that in every branch where that folder is still tracked, and the error should not be seen again.

How to ignore eclipse metadata but preserve the template?

I've got an ARM project in Eclipse...Actually, I'm using the STM Workbench packaging of Base-CDT-Eclipse.
I'm working with a few other guys and we're using a git server to push and pull from.
However, everyone has a little bit different setup as far as where their toolchains are, OS's, etc.
This is causing trouble, because we're git dummies, and when we push changes after working locally, we do
git add .
git commit -m "some message"
git push origin master
And when we pull changes, we just do
git pull origin master
And pray that there no one else did anything in the meantime, because we're afraid of merging differences, but that's a different story.
Anyway, this whole project has a few sub directories that include things like datasheets, Word documents, and what-not...but, it also includes the metadata for the Eclipse project. So, the last person to commit also pushes their unique settings for things like tool-chain path, preferred builder, etc. This breaks the other guys' setup and after each pull, everyone else has to manually update their project settings to fix this.
So, what files are special to Eclipse for project settings and how can I tell git to ignore these files if they already exist? They need to be available for, say, a git clone but they need to be ignored for subsequent git push's and git pull's.
If you need the setting file and not rename it and it's ok forsetting file need not to do version control, so there is a way by .gitignore with below steps:
Create a .gitignore file. touch .gitignore
Edit and save the .gitignore file
.gitignore
filename
Remove the caches from version control. git rm --cached filename
Commit and push
You can ignore those files changes locally with:
git update-index --skip-worktree -- .project
git update-index --skip-worktree -- .classpath
See: "Difference Between 'assume-unchanged' and 'skip-worktree'", it should better resist to git pull.
Another option would be to a content filter driver which generates (automatically on git checkout) a .classpath if it does not yet exist.
That allows you to version a .classpath.tpl template, and you can keep your actual .classpath completely private (and in your .gitignore)
See this answer for more.

EGit - Switching branches doesn't remove empty directories/packages

I'm using EGIT to manage my GIT repository, which seems to work well so far. However, when I switch from one branch to another the files are correctly switched, however empty directories and packages that exist in one branch but not the other are left over.
I understand that GIT is based on the actual files and not the directories, however this is not ideal as my one branch was a large refactoring and therefore contains many packages that the master branch does not have.
From my research there appears to be a GIT command git clean -d that should cleanup the directories. Does EGIT support this? Or is there a way to execute this command when switching the branch with EGIT?
That looks like bug 345585: "EGit does not prune empty folders when switching branches".
It is still opened, so for now, the git clean -d is your best option (but outside of Eclipse, in a shell session).
Update June 2013, for Egit 3.0 Kepler:
A clean action has been added to the repositories view now.

Problem with Git Repository in Xcode 4

In my iPhone app, I am using the in-built Git repository of Xcode 4 so that all the team members can work on the same project.
Now the problem is that even after I commit my changes to the repository, It still shows modified (M) symbol in front of the committed file.
What could be wrong?
I want to ensure that once I commit the changes it should not show "M" for that file.
Is there any setting which I have to do to make it work fine?
What can be done?
The built-in Git repository is a local repository only. How do you share that with your team? If you hooked that repository to GitHub, for example, you will experience problems as the implementation is not 100% reliable. I would use the command line in this case and git add/commit/push the changes. There are discussions and tutorials in the GitHub Blog.
Without knowing what you're doing in Xcode, or how you have set up your repository all I can say is that you should check the status of your repository in the command line. Maybe your commit fails for some reason and you're not seeing the message in Xcode.
Try git status to see what state your repository is in.
Try git add <your files> and then git commit to see if you can actually commit your changes.
Did you stage your files before committing (git add)? Otherwise the commit will do nothing.
You would need to Push the changes in Xcode 4 to remove the "M" or modified status. If you don't have the command line mojo like most people, you can just use the functions built in as they were intended.
It won't solve your issue of sharing as it is only a local repo. I'm finding that even using Xcode 4 with an outside repo, you need to learn some command line stuff or it just isn't going to work, or at the very least kick your butt enough to make you consider giving it up.
*edit
Just to make it clear, the process for Xcode 4 is as follows:
File-->Source Control-->Commit
File-->Source Control-->Push