Many times, we will encounter such a scene
- Changed a new computer, need to clone gitlab repos one by one?
- Not sure which repo contains the maven.aliyun.com setting?
- Can I update local repos in batches?
If you have the above questions or situations, you can try some methods of batch processing repos in this article
batch clone
1
|
|
The content of cloneRepos.rb script is as follows
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 twenty one twenty two twenty three twenty four 25 |
|
Parameter explanation
- code-git-xxxxxx The token obtained from gitlab is obtained according to the instructions in the following figure
- The directory where ../projects is stored
Notice
This script can only process the first 200 repos at present. If necessary, you can modify the code to process it yourself.
Batch project search
quick search
For example, we want to search maven.aliyun.com
1 2 3 4 5 6 7 8 9 |
|
The content of gradleSearch.sh is as follows
1 2 |
|
Bulk update
1
|
|
Its content is like this
1 2 3 4 5 6 7 8 9 10 |
|
Notice
- If the current repo has uncommitted changes, it cannot be updated.
Through the above few scripts, we can easily achieve efficiency improvement.
This article is reprinted from https://droidyue.com/blog/2022/09/04/speed-up-about-cloning-git-repos-and-updating-them/
This site is for inclusion only, and the copyright belongs to the original author.