I'm working on Xamarin.Forms project and I'm in the master branch and I'm trying to check out another branch but I'm getting this error in VS 2019:
& I'm getting this error when using commands:
Notes:
This is my first time checking out this branch
I can check out other branches normally
The paths mentioned in the error don't exist.
I don't care about the ios application for this project, I focus on the Android one.
What should I do to fix this error and check out the branch successfully?
In command line, try and set a sparse checkout clone first, then open the IDE for your Xamarin project:
git clone --filter=blob:none --no-checkout https://github.com/remote/project
cd project
git sparse-checkout set /* !/.vs/JM?/xs/project-cache
git sparse-checkout init
# that sets git config core.sparseCheckoutCone true
git read-tree -mu HEAD
The idea is to ignore the content of .vs/JM?/xs/project-cache (assuming .vs is right under the root folder of the repository) on checkout (of any branch).
Related
I keep on getting the following error when building a project in Xcode 11 which includes a couple of swift packages added via new Xcode interface
Showing All Messages :terminated(1): /Applications/Xcode-beta.app/Contents/Developer/usr/bin/git -C /Users/<xyz>/Library/Developer/Xcode/DerivedData/<xyz>-cqkqfkidemtecxegtugdwffhvvmp/SourcePackages/checkouts/ios-sign-in-with-apple checkout -f 2b61cc97dea9d34f913c22c799476eb8e0a31144 output:
Note: checking out '2b61cc97dea9d34f913c22c799476eb8e0a31144'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 2b61cc9 inicial project
This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-checkout.
Linking git-lfs solved the issue
ln /usr/local/bin/git-lfs /Applications/Xcode-beta.app/Contents/Developer/usr/bin/git-lfs
Got the inspiration from here github link
I have a problem with my Xcode project. I'm using submodules of frameworks like alamofire. I added this following the github steps... running the following command:
$ git submodule add https://github.com/Alamofire/Alamofire.git
and then the next step like drop into project...
But my problem is then the commit and push. When I clone the project from git using sourcetree in other computer or I remove the repo and I download this, the folder of alamofire and others sdk are empty.
If I open the xcode project is red name, because haven't the files. But in my first local repository all work and if I try change to submodule in sourcetree the files are downloaded and appear.
But if I use:
git clone --recursive https://github.com/meme/myRepo.git FOLDER_NAME
with this command all files are downloaded.
I want get the content of those submodules when I clone my repo into a computer with sourcetree.
How can I solve this to then download the repo appear directly the sdks?
As illustrated in this thread:
There is a "Recurse submodules" option when cloning under "Advanced Options".
That should be enough for your original question.
However:
nothing when pulling, checking out, or switching branched; and no manual recursive submodule update functionality.
So:
The only way I know of updating submodules in SourceTree is to manually open each submodule (and recursively open each nested submodule) and look at the "Uncommitted changed" select only submodules that appear to have change and "Reset" the changes.
I have same xcode project on two deferent macbooks with different code.we need to merge that code but we are not using any git account.We need to merge same file as well,I mean we have same viewcontroller and added two people add a code in single view controller How i can merge it.
For example:
I have a view controller Name "XYZ"and Person 1 added "Login Method"
into "XYZ" and person 2 added "Sign up Method" into XYZ. and both code
are on deferent macbook without any git account how I can merge
that.
Since you use the git tag, I will provide the way to do version control by git.
First, please sign up account for bitbucket (free for private repository) or github (only free for public repository). And create a repository. They are as the remote git repository(repo).
Then use git bash for local repository.
In one macbook, use these steps:
git clone <URL for your bitbucket or github repo>
cd reponame
copy your xcode project in reponame folder
git add .
git commit -am 'code version from first macbook'
git push
Now the code in the first macbook is pushed in your remote repo.
In the other macbook, use these steps:
In an empty folder, use git init
copy your xcode project in this folder
git add .
git commit -am 'code version from second macbook'
git remote add origin <URL for your bitbucket or github repo>
git pull origin master
Now the code from macbook1 is merging in macbook2
If there has conflict files, you should check and save them, and then use git add . and git commit -m 'solve merge conflict'.
Now this is the version that you merge the different macbooks together. You can push the version in remote repo by git push.
More git related, you can refer git book.
Any version control system comes to handy in this kind of situations. Merging manually is the option available other than version control system. Either merge using version control system like git or manually merge the files which is very hard to workout.
I'm working off of an existing project that I have been committing and pushing to git. For a couple reasons, I had to change rails versions from 4.0 to 3.2.6 and use existing project files from a tutorial by downloading the files and replacing my local app folder with them.
Now I can't push to my existing repo on git that I have been working on.
If I try to commit, I get two errors:
error: pathspec 'origin' did not match any file(s) known to git.
error: pathspec 'master' did not match any file(s) known to git.
I tried to delete the local app folder, clone the repo and then replace all of the files with the 3.2.6 version app that I have been working on but I still get the same commit errors.
You can try to specify the full git push command:
git pull -u origin master
If it doesn't work, check if your remote declaration were altered in any way:
git remote -v
also, as show in this article, list references and branches:
git branch -avvv
git show-ref
check that you are in a branch, and not in a detached HEAD.
Make sure you don't have a branch named 'origin' (which would be confusing here)
As mentioned in this issue (for git svn, which isn't your case, but can still give interesting idea), trying to clone again the repo could lead to a non-corrupted .git folder, and the ability to push again.
Did you checked your git config file placed in
.git/config
in your project folder? You can find the details of your repo & branches information in this file.
Hope it helps.
I want to use TFS as a version control for developing one of our iPad applications. I followed this article for configuring my Xcode project.
After doing all the steps mentioned in the blog i am able to checkin and checkout the whole project. But I am not able to push changed files back to TFS server. More over I am getting following error on executing git push command
fatal:
https://username#mydomain:8080/tfsprod/info/refs?service=git-receive-pack
not found: did you run git update-server-info on the server?
Any Help would be much appreciated.
Just moving the comments into an answer.
You can't use git push. You need to use either git tf checkin or git tf checkin --deep (if you want a check in per git commit).
Reference documentation for git tf checkin is here