How To Delete File From RTC Changeset Using CLI - version-control

I'm using the RTC 3.0.1 CLI (lscm) and I have a file checked into a changeset that I would like to delete. There doesn't appear to be a straightforward way to do this, any idea?

I hate answering my own question, but I figured it out. Perhaps this will help others.
RTC really makes you think about source control in a different way than SVN, or even git. In order to delete a file from an RTC changeset, you just remove the file locally and checkin the directory.
$ rm myfile
$ cd ..
$ lscm checkin mydir
Undoing changes with the 'undo' command
$ lscm undo myfile
Here is a rosetta stone of sorts for the RTC CLI that clued me in:
Git v Subversion v RTC

From what I can see in the help page, there is also one workaround:
relocate a file from one change set to another.

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.

How to remove a specific directory from GitHub using Eclipse

I've looked all around for a few days now trying to figure this out because our .gitignore even though it lists /bin/ folder it still keeps freaking commiting the whole folder and its getting annoying.
Now we have a whole bunch of crap in a /bin/ folder in our GitHub repository and I have no idea how to remove it. I've tried looking at other peoples examples but they keep talking about a shell command that I don't have in eclipse (or at least don't know how to access)
The sad news is that if a file has been already committed to GitHub, git will continue to version that file.
This means if I commit the entire bin/ then add it to .gitignore, the files will still persist in GitHub. And, if these files in bin/ change, they will also be pushed in the commit because they are versioned.
Luckily, you can remove files and directories from GitHub completely. You need, though, to get to a command line running git. If you have the GitHub application installed, that probably means you have git.
Open command prompt in Windows or Terminal in Mac OS.
Navigate to the directory (ie. cd ~/Workspace/Project) and run the following:
git rm bin/* -f
git commit --amend
git push -f
This should work. Check out this article on the GitHub that also outlines the process.
Hope this helps you!
Disclaimer: always make sure you do your research before working with git. If you have various branches / other complicated stuff going on, this process might be different

Eclipse (GGTS) "Computing Git status for repository [username]"

Each time I save an edit in Eclipse (GGTS/STS v3.4) it automatically runs the task: Computing Git status for repository [username].
The CPU usage rockets but it never seems to make any progress. I've left the process running for up to 15 minutes before giving up and stopping it manually. It then restarts the next time I save a change.
Presumably EGit is trying to synchronise but it isn't really clear what or why. Does anyone know why this might be happening and how to stop it?
Older versions of EGit used to automatically connect a project to its Git repository in case it finds a .git in any of the project's parent directories.
In your case, it seems you have a Git repository in your home directory. Depending on the size of your home directory, this can take a long time.
Since EGit 3.0.2, the home directory is no longer automatically indexed. So, make sure you are using EGit 3.0.2 or higher. In case you are using Eclipse 4.3.0, upgrade to 4.3.1. Otherwise upgrade to the newest version from the EGit download page.
After upgrading, open the Git Repositories view (using Ctrl+3 or Cmd+3 and typing its name). Then find the repository named [username] and remove it from the view.
In order to stop this thread from running, try:
rm -r .metadata/.plugins/org.eclipse.core.resources/.projects/*/org.eclipse.egit.core
and
rm -r .metadata/.plugins/org.eclipse.core.resources/.projects/*/.indexes/properties.index
seems to be working! credit to http://willtipton.com/coding/2014/09/21/Eclipse-building-git-something.html
Amir Dahan and Ryan Poolos's answer does work. Thanks a lot.
In Windows OS, you can open a "git bash" window if a git client was installed, then input the command.
If you just delete the "properties.index",they can be created again when you start the Eclipse next time.
cleaning up org.eclipse.egit.core and properties.index was useful. It works for me to get rid of computing Git status issue.
But now I cannot sync my project.

How to synchronize a project with svn repository after deletion of local files in xcode?

I have added some files to svn repository during initial revisions. But now, those files are gone and that was done by removing them directly in xcode 4.2. But they still exist in svn and I want to update the svn repository to my local project version. I know that I could use svn rm command to delete every file but the idea about that makes me annoyed because I will need to find, pick and delete every file manually. Any less painful solutions?
ps. also, any advices on how to check the difference between local project and svn repository are welcome. Currently, if I'm performing update then xcode is sayging that my local copy is up to date, so I have even manually to find the missing files.
If you don't mind going into the command line, you could run svn status and find the files you deleted. These will start with the exclamation point. Here's an example from a repository I just futzed with:
$ svn status
! subversion/pre-commit-kitchen-sink-hook.html
! subversion/svn-watch.html
! bludgen/bludgen.html
! duplicate-properties-files/fixup.html
! cvstools/group.html
! cvstools/find-branch-usage.html
A cvstools/someprogram.py
M cvstools/find-branch-usage.pl
! cvstools/scramble.html
M cvstools/findNames.pl
Now, all you need to do is find the names of the programs. If you have no spaces in the names of your programs, a simply [awk] script should be sufficient:
$ svn status | awk '/^!/ {print $2}'
subversion/pre-commit-kitchen-sink-hook.html
subversion/svn-watch.html
bludgen/bludgen.html
duplicate-properties-files/fixup.html
cvstools/group.html
cvstools/find-branch-usage.html
cvstools/scramble.html
Now that you have a list of programs, you could run that through xargs into a svn rm command:
$ svn status | awk '/^!/ {print $2}' | xargs svn rm
D subversion/pre-commit-kitchen-sink-hook.html
D subversion/svn-watch.html
D bludgen/bludgen.html
D duplicate-properties-files/fixup.html
D cvstools/group.html
D cvstools/find-branch-usage.html
D cvstools/scramble.html
Fortunately, Macs come with the Subversion command line client. This will delete the files you manually removed via Subversion and will allow you to commit your changes. You'll be able to then update your copy of the repository with the latest code. There might be some conflicts (you deleted a file that someone in a later revision updated), but these should be pretty manageable.
You can use svn diff to look for differences between your current working copy and the HEAD revision of the repository. Unfortunately, the --summarize parameter only works if you do a repository to repository difference. However, you can filter out the files that are different by using grep to look for lines that start with Index::
$ svn diff -rHEAD | grep "^Index:"
Index: windows-tools/which.pl
Index: subversion/pre-commit
Index: subversion/README
Index: subversion/control.ini
Index: subversion/pre-commit-kitchen-sink-hook.html
Index: subversion/svn-watch.html
Index: cvstools/findNames.pl
Index: cvstools/group.html
Index: cvstools/find-branch-usage.html
Index: cvstools/someprogram.py
Index: cvstools/find-branch-usage.pl
Index: cvstools/scramble.html
Index: bludgen/bludgen.html
Index: duplicate-properties-files/fixup.html
The only real issue is whether the Subversion client that XCode uses is compatible with the Subversion command line client. For example, the VisualStudio Subversion client uses _svn as the name of the Subversion information directories while the command line client uses .svn.
I believe that the XCode Subversion client is compatible with the revision 1.6.x of the Subversion command line client (and even earlier revisions all the way back to 1.4), but not with the latest 1.7 version of Subversion.
If you haven't tampered with your Mac's Subversion installation, it should be fine.
The only way that I'm aware of to do what you are trying to is:
Goto File->Source Control->Repositories
Select Your repository
Click Commit
Click Flat view icon (on the left)
Any missing files are shown as !, and you can right click to discard the change.
EDIT - Sorry, I misunderstood the problem. This may help you to find missing files, but wont help you commit. I was thinking you were trying to restore the deletions, not commit them.

How can I get a complete version from TortoiseHg

I am using TortoiseHg as my source control for developing a CMS project written in .NET/C#. I don't know how can I get a whole complete version from my source repository. Is it possible? a version for a specified date.
Thank you.
The command hg update will update your working directory to any prior version of your choice.
The command hg archive will provide you with a zipfile or tarball representing any point in history.
For both commands you can specify your exact revision using the -r argument.