This is quick tutorial on how to use capabilities of GIT tools for software development in team.
- To access the GIT repository:
- Add your Git username and set your email
- To get a GIT repository use this command
- To download the latest changes in the project
- To view all branches in the project
- To work on an existing branch
- To create a new branch and start working with it
- To add new file or folder in your branch
- To add all new files or folders in your branch
- To view the changes you’ve made
- View differences
- To save all changes that you made in local machine GIT repository
- To save the changes in remote server machine GIT repository (origin branch)
- If you want merge NAME-OF-BRANCH with protected dev branch create merge request on GitLab site for MpdRoot or BmnRoot. Then if your branch has passed the testing without errors, you can merge branches by clicking the button on the site.
To get zip archive without registration and SSH keys (only for read):
It is important to configure your Git username and email address, since every Git commit will use this information to identify you as the author.
On your shell, type the following command to add your username:
git config --global user.name "YOUR_USERNAME"
To set your email address, type the following command:
git config --global user.email "email@example.com"
To view the information that you entered, along with other global options, type:
git config --global --list
git clone firstname.lastname@example.org:nica/mpdroot.git
git clone email@example.com:nica/bmnroot.git
git clone firstname.lastname@example.org:nica/spdroot.git
git branch -r
To switch to an existing branch, so you can work on it:
git checkout NAME-OF-BRANCH
Please use names for branches in accordance with the task for common understanding, like: feature-new-geometry or bugfix-old-problem. Spaces won’t be recognized in the branch name, so you will need to use a hyphen or underscore.
git checkout -b NAME-OF-BRANCH
git add NAME-OF-FILE
git add .
It’s important to be aware of what’s happening and the status of your changes. When you add, change, or delete files/folders, Git knows about it. To check the status of your changes:
To view the differences between your local, unstaged changes and the repository versions that you cloned or pulled, type:
git commit -am "Some comments add here"
git push origin NAME-OF-BRANCH
- If something went wrong
- Delete all changes in the local Git repository
- Unstage all changes that have been added to the staging area
To delete all local changes in the repository that have not been added to the staging area, and leave unstaged files/folders, type:
git checkout .
To undo the most recent add, but not committed, files/folders:
git reset .
- GIT software for Windows download here
For example: Tortoise git client