Jump to content

cm usage help


ahrbe1

Recommended Posts

Can somebody help me with `cm` command-line equivalents for a few git commands that I regularly use?  I've found equivalents for most of my workflow, but a couple things have eluded me: 

1. Reset the working directory to a clean state. E.g. `git reset --hard HEAD`. The closest equivalent I found to this seems to be `cm undo -r .` Is there something better?

2. Show a patch containing untracked changes in the workspace. E.g. `git diff`. I was unable to find an equivalent for this.

3. Show a patch containing staged changes in the workspace, i.e. things marked for add. Such as `git diff --cached`

4. Remove files that were deleted on disk from version control. E.g. `git add -u .`

5. Is there a way to show how big a commit will be? E.g. total size (MiB) of the upload that would be transmitted.

Thanks!

Link to comment
Share on other sites

  • 1 month later...

Hi @ahrbe1,

Quote

1. Reset the working directory to a clean state. E.g. `git reset --hard HEAD`. The closest equivalent I found to this seems to be `cm undo -r .` Is there something better?

"cm undo . -r" :(Undoes all changes in the current directory recursively. If executed from the workspace's root, undoes all changes in the entire workspace.) If you are looking for a way to undo pending changes recursively,  cm undo . -r can be used.

Quote

2. Show a patch containing untracked changes in the workspace. E.g. `git diff`. I was unable to find an equivalent for this.

It seems like you are looking for "cm diff",  you can find more details of the command with "cm diff --help".

Quote

3. Show a patch containing staged changes in the workspace, i.e. things marked for add. Such as `git diff --cached`

Are you currently using distributed workspace? https://support.unity.com/hc/en-us/articles/360047015532--Workflow-Centralized-Vs-Distributed 

Quote

4. Remove files that were deleted on disk from version control. E.g. `git add -u .`

The link below explains about the situation. Please read the link and let us know if you have any questions.
https://www.plasticscm.com/documentation/cli/plastic-scm-version-control-cli-guide#Localchanges 

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • Create New...