step1
1. Use the following command to create a local warehouse in the git directory you want to create.
It is not as good as: MyApplication
execution:
git init
step2 associate remote warehouse
git remote add origin remote-url
remote-url is replaced by the remote warehouse address
step3 add ignore file
The steps here can be operated using ide, which is more intuitive
step4 View the files that need to be tracked
git status
step5 Add files that need to be tracked
git add .
6. Submit
git commit -m"IssueID=ID 提交描述"
ID is the requirement id, or the bugid for modifying the bug
7 Generate ReadMe file locally
git pull --rebase origin master
If there is no readme file locally, git push -u origin master
an error will be reported
8 Push
Is it possible to allow irrelevant historical commits and force merges
git pull origin master --allow-unrelated-histories
9.hook
gitdir=$(git rev-parse --git-dir); scp -p -P 29418 xx@ip:hooks/commit-msg ${gitdir}/hooks/
xx is the current git user name
ip is the hook address
10. Submit
git commit --amend
Step 8 directly to 11 will report an error, prompting to add change-id, follow the prompts to perform steps 9 and 10
11 Push to the review area
Gerrit does not allow users to push directly, it needs to be submitted to the review area
git push origin master:refs/for/master
After 12 reviews
git pull origin master