GIT Plugin/en: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „== Introduction == The plugin provides git-functionality for testsuites. For proper work you need a remote-repository and access to it without entering user…“)
 
 
(12 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 3: Zeile 3:
The plugin provides git-functionality for testsuites.
The plugin provides git-functionality for testsuites.


=== Precondition ===
For proper work you need a remote-repository and access to it without entering user name and password.


For proper work you need a remote-repository and access to it without entering user name and password. For configuration you have to set user name and mail-address in the expecco-configuration (see [[Settings GitSettings/en]]).
Before starting a git-command, that affects your testsuite-files, a copy of these files will be created. They become the suffix ".last.sav".
<br>The git-functionality will not work, if you use sub-directories in your project. The .git-directory must be in the same directory as your files of the testsuites.


=== In Case of an Error ===

Before executing any git-command, which affects your testsuite-files, a copy of those files will be created. They get the suffix "<testsuite>.last.sav".


== Initialization ==
== Initialization ==


=== Administration Configuration ===
=== Clone ===

Sets the global git parameters for user name and mail-address.

Executed git-command: ''git config --global user.name=<user name>'',
''git config --global user.email=<mail address>''.

=== Administration Clone ===


Provides the functionality of 'git clone': Cloning a repository into a a new local directory.
Provides the functionality of 'git clone': Cloning a repository into a a new local directory.
A dialog asks for the url of the remote repository.
A dialog boxes ask for the url of the remote repository and the root directory of your projects.


Executed git-command: ''git clone <repository-url>''.
Executed git-command: ''git clone <repository-url>''.



== Adding and Committing ==
== Adding and Committing ==


=== Add ===
=== Add ===
Before you can commit your new or changed testsuite, you have add the file to the git index with the '''''Add'''''-command.


Before you can commit your new or changed testsuite, you have add the file to the git index.
Executed git-command: ''git add <testsuite-file>''.

<!-- git add: Add file contents to the index -->
Executed git-command: ''git add <testsuite>''.


=== Unstage ===
=== Unstage ===


Removes an added testsuite from index. She is still modified, but not destined for commit.
Removes an added testsuite from index. It is still modified, but not destined for commit.


Executed git-command: ''git reset HEAD <testsuite-file>''
Executed git-command: ''git reset HEAD <testsuite>''


=== Add All and Commit... ===
=== Add All and Commit... ===


Adds all modified files and commits them in one step. You will be asked for input of a log-message.
Adds all modified files and commits them in one step. You will be asked for entering a commit message. An empty commit message is not allowed.


Executed git-command: ''git commit -a -m "<log-message>"''
Executed git-command: ''git commit -a -m "<commit message>"''


=== Commit.. ===
=== Commit.. ===


Commits all added files. A message-box will appear to enter the commit-message. An empty commit-message is not allowed.
Commits all added files. A message-box will appear to enter the commit message. An empty commit message is not allowed.


Executed git-command: ''git commit -m "<log-message>"''
Executed git-command: ''git commit -m "<commit message>"''


=== Commit (amend) ===
=== Commit (amend) ===


Replace the tip of the current branch by creating a new commit. The new commit has the same parents and author as the current one.
Replace the tip of the current branch by creating a new commit with a new commit message. The new commit has the same parents and author as the current one.


You should understand the implications of rewriting history if you amend a commit that has already been published!
You should understand the implications of rewriting history if you amend a commit that has already been published!
Zeile 58: Zeile 56:
Executed git-command: ''git commit --amend''.
Executed git-command: ''git commit --amend''.


=== Discard changes in working directory ===
=== Discard Changes in Working Directory ===


If you get conflicts by changing the branch, because you have uncommitted changes in your file, you can discard the changes. Attention: your changes are lost!
Discards the changes since the last commit. Attention: Your changes are lost!


If you get conflicts by changing the branch, because of uncommitted changes in some of your files, you can discard or commit your changes.
The other possibility is to commit your changes.

Executed git-command: ''git checkout -- <Testsuite>''.


Executed git-command: ''git checkout -- <testsuite>''.


== Branches ==
== Branches ==


=== Create Local Branch ===
=== Create Local Branch... ===


Create a new local branch with a given name.
Creates a new local branch with a given name.


Executed git-command: ''git checkout -b <Branchname>''.
Executed git-command: ''git checkout -b <branch>''.

=== Delete Local Branch... ===

Deletes a local branch.

The branch must be merged into the current branch. Otherwise the deletion will be refused.

Executed git-command: ''git branch -d <branch>''.


=== Checkout Branch... ===
=== Checkout Branch... ===


Checks out a branch. In a dialog you can choose the desired branch.
Checks out a branch. In a dialog box you can choose the desired branch.


If you have uncommitted changes, git rejects the checkout of the new branch. You can discard (see below) or commit your changes and try again.
If you have uncommitted changes, git rejects the checkout of the new branch. You can discard or commit your changes (see above) and try again.


Executed git-command: ''git checkout <Branchname>''.
Executed git-command: ''git checkout <branch>''.


=== Push ===
=== Push ===


To publish your test-suite to the remote-repository you have to push it.
To publish your commits to the remote-repository you have to push it.


Executed git-command: ''git push''.
Executed git-command: ''git push''.
Zeile 93: Zeile 98:
Incorporates changes from the remote repository into the current branch.
Incorporates changes from the remote repository into the current branch.


Because automatically merge by git isn't possibly, you can get merge-conflicts. To avoid this, better use '''''Merge'''''. If you get unresolvable conflicts, you can reset the files wit '''''Merge Abort after Conflict''''' and try it with '''''Merge'''''.
Because automatically merge by git isn't possible in any case, you can get merge-conflicts. To avoid this, better use '''''Merge'''''.

If you get unresolvable conflicts, you can reset the files wit '''''Merge Abort after Conflict''''' and try again with '''''Merge'''''.


Executed git-command: ''git pull''.
Executed git-command: ''git pull''.




== Comparing and merging ==
== Comparing and Merging ==


=== Fetch ===
=== Fetch ===
Zeile 106: Zeile 113:
Executed git-command: ''git fetch''.
Executed git-command: ''git fetch''.


You can compare and merge your testsuite in three different kinds.

In every case the ''Expecco-ProjectDifferenceBrowser'' will open. After merging you have to save, add and commit your testsuite (and then push).


=== Merge ===
=== Merge ===


Merge with HEAD of the current branch (Only possible on remote-branches.)
Merges with HEAD of the current branch. (Only possible on remote-branches.)


You get the newest version of the current branch from the repository with the changes done by others. If there exists not automatically mergeable differences between the two version the ''Expecco-ProjectDifferenceBrowser'' will open and you can take over your changes.
You get the newest version of the current branch from the repository with the changes done by others. If there exists differences that cannot merged automatically between the two version the ''Expecco-ProjectDifferenceBrowser'' will open and you can take over your changes.


Executed git-command: ''git fetch''
Executed git-command: ''git fetch''
Zeile 121: Zeile 125:
=== Merge with Branch... ===
=== Merge with Branch... ===


Merges the content of yout testsuite from another branch, you select in a dialog-box, to your testsuite-content.
Merges the contents from another branch, you select in a dialog box, to your testsuites.


Executed git-command: ''git fetch''
This command doesn't change the branch in your working directory.
''git merge <branch>''

Executed git-command: ''git checkout <comparebranch>''
''git fetch''
''git checkout <currentbranch>''
''git merge''


=== Merge Commit ===
=== Merge Commit ===


You can finish the merge with a final '''Merge Commit''. You maybe override changes from others.
You can finish a manually merge with a final '''Merge Commit''. You maybe override changes from others.

This functionality you doesn't need usually. It is integreted in the merge commands above.


Executed git-command: ''git commit -a --no-edit''
Executed git-command: ''git commit -a --no-edit''
Zeile 142: Zeile 144:
Executed git-command: ''git merge --abort''
Executed git-command: ''git merge --abort''


== Information ==

== Status dialogs ==


=== Show Log ===
=== Show Log ===


Displays a dialog with the commit logs of the current branch.
Displays a dialog box with the commit log of the current branch.


Executed git-command: ''git log''
Executed git-command: ''git log''
Zeile 157: Zeile 158:
Executed git-command: ''git status''
Executed git-command: ''git status''


=== Current state in the window status line ===

After every git command, the state of then working tree will be displayed in the status line of the expecco window.
==== State ====
* added: new file added.
* modified: file modified, not added
* staged: file modified and added
* deleted: file deleted
* renamed: file renamed
* unmerged: file not merged
* unknown: new file, not added
* ignored: file ignored (settings in .gitignore)

==== Branch ====
* name of the branch
* ahead: your working copy is ahead the remote copy: you can push your commits.
* behind: your working copy is behind the remote copy. You can pull to get the changes.
* ahead / behind: your branch has deverged. You have to merge.


== Not implemented ==
== Not implemented ==
* Use of the git-stash command.
* Drop branches.
* Use of the git-stash-command.

Aktuelle Version vom 17. März 2022, 14:35 Uhr

Introduction[Bearbeiten]

The plugin provides git-functionality for testsuites.

Precondition[Bearbeiten]

For proper work you need a remote-repository and access to it without entering user name and password. For configuration you have to set user name and mail-address in the expecco-configuration (see Settings GitSettings/en).
The git-functionality will not work, if you use sub-directories in your project. The .git-directory must be in the same directory as your files of the testsuites.

In Case of an Error[Bearbeiten]

Before executing any git-command, which affects your testsuite-files, a copy of those files will be created. They get the suffix "<testsuite>.last.sav".

Initialization[Bearbeiten]

Clone[Bearbeiten]

Provides the functionality of 'git clone': Cloning a repository into a a new local directory. A dialog boxes ask for the url of the remote repository and the root directory of your projects.

 Executed git-command: git clone <repository-url>.


Adding and Committing[Bearbeiten]

Add[Bearbeiten]

Before you can commit your new or changed testsuite, you have add the file to the git index.

 Executed git-command: git add <testsuite>.

Unstage[Bearbeiten]

Removes an added testsuite from index. It is still modified, but not destined for commit.

 Executed git-command: git reset HEAD <testsuite>

Add All and Commit...[Bearbeiten]

Adds all modified files and commits them in one step. You will be asked for entering a commit message. An empty commit message is not allowed.

 Executed git-command: git commit -a -m "<commit message>"

Commit..[Bearbeiten]

Commits all added files. A message-box will appear to enter the commit message. An empty commit message is not allowed.

 Executed git-command: git commit -m "<commit message>"

Commit (amend)[Bearbeiten]

Replace the tip of the current branch by creating a new commit with a new commit message. The new commit has the same parents and author as the current one.

You should understand the implications of rewriting history if you amend a commit that has already been published!

 Executed git-command: git commit --amend.

Discard Changes in Working Directory[Bearbeiten]

Discards the changes since the last commit. Attention: Your changes are lost!

If you get conflicts by changing the branch, because of uncommitted changes in some of your files, you can discard or commit your changes.

 Executed git-command: git checkout -- <testsuite>.

Branches[Bearbeiten]

Create Local Branch...[Bearbeiten]

Creates a new local branch with a given name.

 Executed git-command: git checkout -b <branch>.

Delete Local Branch...[Bearbeiten]

Deletes a local branch.

The branch must be merged into the current branch. Otherwise the deletion will be refused.

 Executed git-command: git branch -d <branch>.

Checkout Branch...[Bearbeiten]

Checks out a branch. In a dialog box you can choose the desired branch.

If you have uncommitted changes, git rejects the checkout of the new branch. You can discard or commit your changes (see above) and try again.

 Executed git-command: git checkout <branch>.

Push[Bearbeiten]

To publish your commits to the remote-repository you have to push it.

 Executed git-command: git push.

Pull[Bearbeiten]

Incorporates changes from the remote repository into the current branch.

Because automatically merge by git isn't possible in any case, you can get merge-conflicts. To avoid this, better use Merge.

If you get unresolvable conflicts, you can reset the files wit Merge Abort after Conflict and try again with Merge.

 Executed git-command: git pull.


Comparing and Merging[Bearbeiten]

Fetch[Bearbeiten]

Downloads objects and refs from the remote repository, but don't change the local files.

 Executed git-command: git fetch.


Merge[Bearbeiten]

Merges with HEAD of the current branch. (Only possible on remote-branches.)

You get the newest version of the current branch from the repository with the changes done by others. If there exists differences that cannot merged automatically between the two version the Expecco-ProjectDifferenceBrowser will open and you can take over your changes.

 Executed git-command: git fetch                   
                       git merge      

Merge with Branch...[Bearbeiten]

Merges the contents from another branch, you select in a dialog box, to your testsuites.

 Executed git-command: git fetch
                       git merge <branch>

Merge Commit[Bearbeiten]

You can finish a manually merge with a final 'Merge Commit. You maybe override changes from others.

This functionality you doesn't need usually. It is integreted in the merge commands above.

 Executed git-command: git commit -a --no-edit

Merge Abort after Conflict[Bearbeiten]

If you have unresolvable conflicts after pulling, you can abort the merge. You can retry the merge with Merge.

 Executed git-command: git merge --abort

Information[Bearbeiten]

Show Log[Bearbeiten]

Displays a dialog box with the commit log of the current branch.

 Executed git-command: git log

Show Status[Bearbeiten]

Shows the working tree status.

 Executed git-command: git status

Current state in the window status line[Bearbeiten]

After every git command, the state of then working tree will be displayed in the status line of the expecco window.

State[Bearbeiten]

  • added: new file added.
  • modified: file modified, not added
  • staged: file modified and added
  • deleted: file deleted
  • renamed: file renamed
  • unmerged: file not merged
  • unknown: new file, not added
  • ignored: file ignored (settings in .gitignore)

Branch[Bearbeiten]

  • name of the branch
  • ahead: your working copy is ahead the remote copy: you can push your commits.
  • behind: your working copy is behind the remote copy. You can pull to get the changes.
  • ahead / behind: your branch has deverged. You have to merge.

Not implemented[Bearbeiten]

  • Use of the git-stash command.



Copyright © 2014-2024 eXept Software AG