Posts

Showing posts with the label git

How to clone all projects of a group at once in GitLab?

How to clone all projects of a group at once in GitLab? In my GitLab repository, I have a group with 20 projects. I want to clone all projects at once. Is that possible? 6 Answers 6 Not really, unless: you have a 21st project which references the other 20 as submodules. (in which case a clone followed by a git submodule update --init would be enough to get all 20 projects cloned and checked out) git submodule update --init or you somehow list the projects you have access (GitLab API for projects), and loop on that result to clone each one (meaning that can be scripted, and then executed as "one" command) Here's an example in Python 3: from urllib.request import urlopen import json import subprocess, shlex allProjects = urlopen("http://[yourServer:port]/api/v3/projects/all?private_token=[yourPrivateTokenFromUserProfile]") allProjectsDict = json.loads(allProjects.read().de...

How can I delete all Git branches which have been merged?

How can I delete all Git branches which have been merged? I have many Git branches. How do I delete branches which have already been merged? Is there an easy way to delete them all instead of deleting them one by one? git branch -D deletes branches that have NOT been merged! Use with care! – Dan Solovay Dec 23 '16 at 14:05 To be slightly more specific git branch -D deletes any branch whether it as been merged or not. – PhilT Feb 8 '17 at 9:48 git branch -D You can also do this directly from GitHub, if you go to the 'branches' section of your repo (e.g. github.com/<username>/<repo_name>/branches). There should be a list of all your branche...

git fetch upstream master not working, what is going wrong?

Image
git fetch upstream master not working, what is going wrong? So I'm wondering if there is a problem with the upstream master? I'm not sure if this error happens when everything is updated already or if it's something different. I have added upstream link with no problem, using $ git remote add upstream https://github.com/udacity/course-collboration-travel-plans.git just want to sync with the master now git remote add <name> <url> does not probe to see if there is a server at <url> that can access a Git repository. Are you sure your <url> is correct? (Hint: what happens if you click on the URL in your question?) – torek Jul 1 at 3:27 git remote add <name> <url> <url> <url> 1 Answer 1 ...

setup git repo locally for different people without giving my password

setup git repo locally for different people without giving my password I want to setup a git repo in one of my cloud instance to share with a few people. Currently I've set it in /home/my_home_dir/git_dir. However, it always ask for my password when my teammates want to clone from it. Is there any way to set it up without giving away my password or private key? Thanks... 1 Answer 1 You can invite users to become collaborators to your personal repository. Repositories owned by an organization can grant more granular access. For more information, see "Access permissions on GitHub." Note: GitHub limits the number of people who can be added to a repository within a 24-hour period. If you exceed this limit, either wait 24 hours or create an organization. By clicking "Post Your Answer", you acknowledge that you have read our updated term...

Github desktop revert commit results in >>> HEAD even in a new cloned repository

Image
Github desktop revert commit results in >>> HEAD even in a new cloned repository I try to revert a commit on Github Desktop. There was conflicts so I deleted the whole project and cloned it again to have a completely fresh clone. Still after I reverted the commit I get things like ">>> HEAD". Why can't it just go back to previous commit? I've made an animated gif of what I do: 2 Answers 2 You are reverting—i.e., asking Git to undo —the changes from a commit that is not the most recent commit. If you intend to revert to that commit, i.e., to undo the changes that came after that commit, you should revert the subsequent commit. See also How to revert Git repository to a previous commit? You seem to be misunderstanding GIT, Still after I reverted the commit I get things like ">>> HEAD". Why can't it just go back to previous commit? What you m...

Checkout Git project in Android Studio causes “project does not use Gradle”

Checkout Git project in Android Studio causes “project does not use Gradle” Previously I had a project, used Gradle as build system and Git as VCS and only added src/ , res/ , assets/ and manifest.xml to the repository. (As it is recommended I ignored all build files). Now I use android-studio-3.1.2 and tried to import that project: Gradle Git src/ res/ assets/ manifest.xml android-studio-3.1.2 Checkout project from Version Control → Git → clone Then selected yes for Would you like to create an Android Studio project for the sources you have checked out to … ? yes Would you like to create an Android Studio project for the sources you have checked out to … ? create project from existing source → select project name, location and type (.idea) → … But I ended by this warning: Migrate Project to Gradle? This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system. What causes this problem and how I can solve that? ...

How does one work on a new git branch that depends on another git branch that is not yet merged?

How does one work on a new git branch that depends on another git branch that is not yet merged? Here's my scenario: My project is following the topic branching pattern. I create a branch to fix some problems, let's call this branch problem_fixes. I make my changes, and submit a pull request. I need to start work on a new feature, so I create a second branch called my_feature and commit a bunch of changes. At some point I realize my_feature is dependent on problem_fixes which has not yet been accepted and merged (the my_feature branch relies on some of the fixes from the first branch and I can't make progress without them). Short of badgering my project lead to accept and merge my first branch faster, what is the best process to follow here? I am wondering if I need to start a new, third branch based on problem_fixes (instead of master) and merge in my commits to my_feature? Or will it be okay if I simply merge problem_fixes into my_feature and continue work -- assuming pro...