GIT: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
Zeile 1: Zeile 1:
== Preconditions ==
== Introduction ==


The plugin provides git-functionality for testsuites.
The plugin provides git-functionality for testsuites.


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.

Before starting a git-command, that affects your testsuite-files, a copy of these files will be created. They become the suffix ".last.sav".



== Initialization ==
== Initialization ==
Zeile 21: Zeile 24:
Executed git-command: ''git clone <repository-url>''.
Executed git-command: ''git clone <repository-url>''.


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


=== Add ===
=== Add ===
Zeile 29: Zeile 32:
<!-- git add: Add file contents to the index -->
<!-- git add: Add file contents to the index -->


=== Commit ===
=== Unstage ===


Removes an added testsuite from index. She is still modified, but not destined for commit.
The added files you can commit to your local branch by using the '''''Commit...'''''-command. 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 reset HEAD <testsuite-file>''


=== Add All and Commit... ===
<!-- git commit: Record changes to the repository -->
* '''''Add and commit...'''''<br /> Combines the add- and commit-command.<br />
Executed git-commands: ''git add <Testsuite>''
''git commit -m "<log-message>"''.


Adds all modified files and commits them in one step. You will be asked for input of a log-message.
* '''''Commit (amend)'''''<br />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. <br /> You should understand the implications of rewriting history if you amend a commit that has already been published! <br />
Executed git-command: ''git commit --amend''.


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


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


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 push''.
<!-- git push: Update remote refs along with associated objects -->


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


=== Commit (amend) ===
Incorporates changes from the remote repository into the current branch.


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.
Because autoimatically merge by git isn't possibly, you can get merge-conflicts. To avoid this, better use '''''Merge into newest Version of Branch'''''.


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


Executed git-command: ''git commit --amend''.
=== Fetch ===


=== Discard changes in working directory ===
Downloads objects and refs from the remote repository, but don't change the local files files.


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!
Executed git-command: ''git fetch''.

The other possibility is to commit your changes.

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


== Branches ==

=== Create Local Branch ===

Create a new local branch with a given name.

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


=== Check out branch... ===
=== Checkout Branch... ===


To change your working branch, use the '''''Check out branch...'''''-command. In a dialog you can choose the desired branch.
Checks out a branch. In a dialog 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 (see below) or commit your changes and try again.


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


== Conflict handling ==
=== Push ===


To publish your test-suite to the remote-repository you have to push it.
=== Discard changes in working directory ===


Executed git-command: ''git push''.
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!


=== Pull ===
The other possibility is to commit your changes.


Incorporates changes from the remote repository into the current branch.
Executed git-command: ''git checkout -- <Testsuite>''.


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'''''.
=== Abort merge after conflict ===


Executed git-command: ''git pull''.
If your branch and the remote-branch have diverged, you will get merge-conflicts after pulling from the repository. Because a git-merge isn't possible with exepecco-testsuite-files, you have to merge it with the ''expecco-ProjectDifferenceBrowser'' (see below). To get a proper state you first have to abort the merge.


Executed git-command: ''git merge --abort''.


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

=== Fetch ===

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

Executed git-command: ''git fetch''.


You can compare and merge your testsuite in three different kinds.
You can compare and merge your testsuite in three different kinds.
Zeile 94: Zeile 110:
In every case the ''Expecco-ProjectDifferenceBrowser'' will open. After merging you have to save, add and commit your testsuite (and then push).
In every case the ''Expecco-ProjectDifferenceBrowser'' will open. After merging you have to save, add and commit your testsuite (and then push).


=== Merge into newest Version of Branch ===
=== Merge ===

Merge with HEAD of the current branch.


Merge 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 and can take over the changes your changes.


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.
This command doesn't switch the branch in your working directory.


Executed git-command: ''git reset --hard @{upstream}''
Executed git-command: ''git fetch''
''git pull''
''git merge''


=== 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 content of yout testsuite from another branch, you select in a dialog-box, to your testsuite-content.
Zeile 112: Zeile 126:


Executed git-command: ''git checkout <comparebranch>''
Executed git-command: ''git checkout <comparebranch>''
''git pull'' (if remote-branch)
''git fetch''
''git checkout <currentbranch>''
''git checkout <currentbranch>''
''git merge''


=== Merge Commit ===


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


Executed git-command: ''git commit -a --no-edit''
Merge your testsuite-content into the version of another branch, you select in a dialog-box.


=== Merge Abort after Conflict ===
This command switches the branch in your working directory to the selected branch.

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''


Executed git-command: ''git checkout <comparebranch>''
''git pull'' (if remote-branch)


== Status dialogs ==
== Status dialogs ==
Zeile 138: Zeile 156:


Executed git-command: ''git status''
Executed git-command: ''git status''



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

Version vom 29. Juli 2019, 13:21 Uhr

Introduction[Bearbeiten]

The plugin provides git-functionality for testsuites.

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

Before starting a git-command, that affects your testsuite-files, a copy of these files will be created. They become the suffix ".last.sav".


Initialization[Bearbeiten]

Administration Configuration[Bearbeiten]

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[Bearbeiten]

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.

 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 with the Add-command.

 Executed git-command: git add <testsuite-file>.

Unstage[Bearbeiten]

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

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

Add All and Commit...[Bearbeiten]

Adds all modified files and commits them in one step. You will be asked for input of a log-message.

 Executed git-command: git commit -a -m "<log-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 "<log-message>"

Commit (amend)[Bearbeiten]

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.

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]

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!

The other possibility is to commit your changes.

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


Branches[Bearbeiten]

Create Local Branch[Bearbeiten]

Create a new local branch with a given name.

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

Checkout Branch...[Bearbeiten]

Checks out a branch. In a dialog 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.

 Executed git-command: git checkout <Branchname>.

Push[Bearbeiten]

To publish your test-suite 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 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.

 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.

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[Bearbeiten]

Merge 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.

 Executed git-command: git fetch                   
                       git merge      

Merge with Branch...[Bearbeiten]

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

This command doesn't change the branch in your working directory.

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

Merge Commit[Bearbeiten]

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

 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


Status dialogs[Bearbeiten]

Show Log[Bearbeiten]

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

 Executed git-command: git log

Show Status[Bearbeiten]

Shows the working tree status.

 Executed git-command: git status


Not implemented[Bearbeiten]

  • Drop branches.
  • Use of the git-stash-command.



Copyright © 2014-2024 eXept Software AG