I like the GitHub Mac app, which I use with my GitHub account. I have joined a GitLab project and I was wondering whether I can use the GitHub app with a GitLab repository. I found a post that discuss that the Windows GitHub app works with GitLab and one that show how to add a repo. Both these posts gave me hope that the GitHub Mac App would work with GitLab. I also see that you can use BitBucket with the GitHub Mac app, but I don't understand whether and how to link a GitLab repository to my GitHub Mac app.
Many thanks!
With the mac app, you have to do the clone on the command line. Open a terminal, navigate to directory that you want to be the parent of your local repo, and git clone the repo. As soon as this is done, go into the github mac app and Go to File->Add Local Repo
You can then add the repo directory file picker, and from there you should be set. The first time you push back to origin through the app, it will ask for your gitlab username and password, and optionally store them in the keychain.
Here is the command in terminal (OSX) that worked for me to clone the repo:
git clone git#gitlab.com:yourusername/yourrepo.git
Hope this helps someone
Related
I wanted to add MacOs support to my Java application. So I bought a new Mac with M1 Chip and created a new subbranch in my Git repository to add MacOs support. The repo is hosted on Dropbox. I have local repos on MacOs and Windows which point to this "remote" repo (Dropbox is added as folder in the home directory).
On MacOs: I used SourceTree to clone the repository. After I finished the first bugfix I pushed to the repo. I can still push and pull on master and the subbranch. No prob on MacOs.
On Windows: Since I pushed from MacOs I have the problem ONLY on Windows. I tried with TortoiseGit, SourceTree and directly on console with "git pull origin master". The result is always fine for the master branch (where I did not push from MacOs yet) but for the subbranch I always get "error: refs/heads/v0.6.x does not point to a valid object!". Doing "git fsck" gives only "dangling tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904". I removed the head branch locally and remotely. It is still there on MacOs but on Windows I get the same error message when I pull from the repo.
Additional Info: The folder refs\heads\v0.6.x exists. So I guess it is pretty sure a problem with the check-in from MacOs.
Any Ideas are very welcome.
I'm trying to archive an XCode source tree in Github. Here's my current process for doing so:
Go to Github and create the private repository that will contain the code. Tell Github that it's an Objective-C application (so it creates the right .gitignore file).
git clone github#github.com:example-org/xcode-repo
cd xcode-repo
unzip ~/xcode-project.zip
git add .
git commit -m 'initial archival import'
git push
Visit github.com for the repository.
Observe that the directory created by the unzip command now appears as a submodule.
I observe that the subdirectory referenced above does not contain a subordinate .git directory. I can't find any signal when searching for this on Google, Bing, or Stack Overflow. Anyone experience this before, and if so, what did you do to resolve the issue?
Thanks for any help folks can offer.
UPDATE: I thought I'd mentioned this earlier, but I either erased it for some reason, or just plain forgot. Apologies for my oversight! I am on a Linux computer, attempting to archive source code developed before I arrived on this project.
It's easier if you reverse the process. Instead of creating a repository in GitHub and cloning it, create your Xcode project first. When you create the project, there's a checkbox to create a local git repository.
Select that checkbox. After creating the project, put the project on GitHub.
If you're using Xcode 9, you can add your Xcode project to GitHub without leaving Xcode. Go to the source control navigator, select the Remotes folder, right-click, and choose Create Remote on GitHub. You can see screenshots and more detailed information in the following Stack Overflow question:
How to connect Xcode 9 and GitHub?
And the following article:
Xcode 9: Adding Your Project to GitHub
UPDATE
Since you're not on a Mac and don't have access to Xcode, you would be better off starting with Step 4. Unzip the Xcode project. Call git init to create a local repository for the Xcode project. Then go to GitHub, create the remote repository, and follow the instructions GitHub gives you to get the local repository on GitHub.
I am working on a project at work and would like to work on it at home as well. I synced the Xcode project to a remote repository to github from my work's mac. I am wondering how I can get a copy on my home's mac and sync it so that I will be able to push commits and pull?
A simple
git clone https://....yourRepositoriy/ongithub
You have to run this with git installed from the Terminal
Should work and copy all files to your local machine
I am trying to understand Git and GitHub for Mac.
Example: I try to clone the FacebookSDK git repo like this. In Terminal I write:
git clone git://github.com/facebook/facebook-ios-sdk.git [path to where you want to save sdk]
git successfully downloads and clones it and I find a folder called facebook-ios-sdk in the specified path.
However GitHub for Mac does not list this repository at all. What I don't understand about GitHub for mac anyway is how is it supposed to know about existing git repositories?
Where am I supposed to install/clone repositories to, so GitHub for Mac recognizes them?
You can tell GitHub for Mac about the repo you cloned in Terminal. But it's easiest to use the "Clone in Desktop" button to launch GitHub for Mac and start the clone. See working-with-repositories for more info.
That way, GitHub for Mac will automatically know about your new repo.
There is a "+" drop-down button in the bottom left of the GitHub for Mac's main window.
"Add Local Repository..." will tell the software about the existing repository you cloned down. "Create New Repository..." will clone new projects for you and ensure that they are tracked from the very beginning.
I think GitHub for Mac only allows you to clone repositories that you yourself created or forked. This is because the entire GitHub workflow is centered on forking, developing, and then requesting the upstream repo to pull your changes.
Here is how to do it:
Browse to the repo you want to work on and click on ⑂ Fork
Open GitHub for Mac
File / Reload Repositories, or ⌘R
File / Clone Repository, or click on the ✚ ▾ button and then on the Clone tab
You should be able to see your newly forked repo, select it and Clone Repository
There's also a 💻 Clone in Desktop button on the GitHub website (right side) but I could never get it to work. It just sends me to the download page for GitHub for Mac.
I've set up Visual Studio 2010 in order to use Git from the Package Manager Console, more precisely:
I've installed msysgit (adding Git executables under %PATH%);
I've installed Posh Git and I've enabled it using the instructions given in this SO answer.
I've also installed GitHub for Windows for easy access to repositories hosted on GitHub.
From the Package Manager Console I am able to do all the operation locally, but when I want to push to a GitHub repository the prompt seems "blocked", I cannot kill git using the Stop button and I'm forced to close Visual Studio and to push from the Git Shell provided with GitHub for Windows.
Using Process Explorer I can see that git spawn the GitHub for Windows program to do the authentication and from there it doesn't seem to advance.
I've resolved this issue by installing the Windows Credentials Store for Git (also suggested in the TFS blog), so that it handles the authentication instead of GitHub for Windows.
Now I can do git push from Package Manager Console -- the credentials store asks for credentials the first time and then pushes correctly to GitHub.
If your repository is hosted on Team Foundation Service (not on GitHub), then besides installing the Windows Credentials Store for Git (as answered by edymtt), you must enable basic authentication before you can use the command prompt to perform Git tasks. You can set this up from your User Profile in TFS. http://msdn.microsoft.com/library/dd286572(v=vs.120).aspx