Configuration |
|
|
Configure user name |
git config --global user.name "The Name" |
Stores the user name in the git configuration. |
Configure email adress |
|
Stores the email adress in the git configuration. |
View configuration |
git config --list |
Displays the git configuration. |
|
|
|
Setup of local Repository |
|
|
|
cd workspace/<FESAproject> git init |
Creates hidden .git directory at project level (<FESAproject>/.git) |
|
|
|
Status Check |
git status |
Displays the repository status (untracked, added, deleted files and folders) |
Add files |
git add <file> <file1> <file2> |
Adds files to the staging area |
Commit locally |
git commit -m "commit message" |
Commits staged files to the local repository |
|
|
|
Branching and Merging |
|
|
Create a branch and switch to the new branch |
git checkout -b <issue-0815> |
Creates the new branch issue-0815 and switches to the branch. Changes in the branch should be committed to the branch. |
Merge branch into master (after add/commit) |
git checkout master git merge <issue-0815> |
Note: Requires the changes in the branch committed to the branch. Switches back to the master branch. Merges the changes in branch issue-0815 into the master branch. |
Switch to master branch |
git checkout master |
Switches back to the master branch. |
|
|
|
Tags |
|
|
Create tag |
git tag -a 1.2.3 -m "version 1.2.3" |
Creates a tag named 1.2.3 |
View tags |
|
Lists existing tags Shows details of tag 1.2.3 |
Pushing tag to remote repository |
git push origin 1.2.3 |
By default tags are not pushed explicitely to the remote repository. This has to be done explicitely. |
Deleting tags |
git tag -d 1.2.3 |
Deletes the tag 1.2.3 |
|
|
|
|
|
|
Working with remote Repositories |
|
|
Create remote repository at git.acc.gsi.de |
|
Uses gittea REST API to create a project in the remote repository |
Configure remote repository |
|
Adds the URL for the remote repository. |
Push to remote repository (after add/commit) |
git push origin master |
Pushes the changes in the local repository to the remote repository. Requests the password. |
View remote repository configuration |
git remote -v |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|