2 questions:
I created a project in xcode which has the following folders in it:
app_icon.png
app_icon#2x.png
FacebookSDK.framework
ProjectName
ProjectName.xcodeproj
I used git to create local repo and push it to a newly created github repo.
When I try to clone the repository using xcode I get the following error:
No submodule mapping found in .gitmodules for path '/ProjectName'
What is the issue? Is it the fact that I have FacebookSDK.framework folder in it?
After two attempts it miraculously was able to clone the project.. However, now when I try to commit anything in xCode the button says "Commit 1085 files" even though it shows 2 files changed...
u can run it :
git rm —cached /ProjectName
Related
I finished an Xcode project and pushed it to github from Xcode 'Source Control' Menu. Then I changed the project name CountryBook to Countries. I Built project and ran. Everything was okay. Then I coiped project folder to desktop as a backup. Then pushed project again. Everything has messed up. Some old named folders and files still exist in repo. Then I deleted every directory and file from github repository. Now, backup version of project is working. But when I try to push it to repo, old files are still exist. I deleted 'origin' from 'Remotes' and created a new repo named 'Countries'. I pushed project again but it was same. A mixed version of old files and new files. When I clone the github version of project, of course it is not runnable. What sould I do and how can I push clean version of my project? I don't want to lose project.
This is Countries repo now:
This is my working project folder with correct content:
I would fix it via command line, lets assume you start from scratch:
Step 1 - prepare the working branch:
Clone the project
Navigate to root folder of the project
Checkout the main branch ("main", "master", or whatever it is)
Create a new branch you will be working with
git clone https://github.com/yourorg/yourrepo
cd yourrepo
git checkout main # or master
git checkout -b fixprojectstructure # branch name can be anything
Step 2 - clean project locally
Delete old project, old workspace, ensure the names in Podfile and Podfile.lock are fine
Build the project and ensure it's working
Step 3 - commit your changes:
# assuming you are in the root of the project
git add .
git commit -m "Some explanation"
Step 4 - push your changes:
I usually do it the lazy way: just run git push, which will show you the proper syntax to push remotely, something like
> git push
fatal: The current branch fixprojectstructure has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin fixprojectstructure
> git push --set-upstream origin fixprojectstructure
Enumerating objects: ...
...
remote: Create a pull request for 'fixprojectstructure' on GitHub by visiting:
remote: https://github.com/.../pull/new/fixprojectstructure
remote:
...
Branch 'fixprojectstructure' set up to track remote branch 'fixprojectstructure' from 'origin'.
Step 5 - merge your changes:
Basically just do what the line above is saying:
Navigate to https://github.com/.../pull/new/fixprojectstructure
Create pull request
Merge pull request to main (or whatever the initial branch was)
Note on the side: configure the gitignore file properly for your repo as well. For starters, follow the gitignore template to create a proper gitignore file, and then change it the way you need to.
For instance:
Usually, if you use cocoapods, you do not store .workspace folder and its contents in the repo. Instead it's generated using pod install command on each machine that needs it.
It's also common to exclude Pods directory from storing in the repo, although there are pro / cons arguments both ways.
I want to create a new empty repository with git. I cannot find a simple solution online that explains this step.
This documentation states "git-init - Create an empty Git repository or reinitialize an existing one" but then doesn't say which options are needed to make it empty:
https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-init.html
Is a --bare repository the same as an empty repository?
Problem:
I have two different projects with different repo's on github, but when I try to use Git (in Bash) after changing the directory to the new project, it keeps pushing with files from the old project.
I think the problem is that git is using the old repo files and thinks the new folder is just additional files perhaps? Basically I want to start from fresh. Can I just start from scratch on my new project with a new repo?
I have tried $ git init in a new directory, but then it just says: "Reinitialized existing Git repository in /home/user/new_project/.git/"
I tried: $ git remote set-url origin git#github.com:User/New_Project.git
but that just updates where it pushes my new project to, and then includes old projects files.
Please help a noob trying to figure things out the hard way 🙏🏼
Delete .git folder:
rm -rf .git
Then create new git repository:
git init
git remote add origin <remote-URL>
git add .
git commit -m "new clean repo"
git push --force origin master
create 1st project
make git init
create a remote repo for 1st project
link remote repo to 1st project
create 2nd project
make git init
create a remote repo for 2nd project
link remote repo to 2nd project
Git will push everything to its proper remote repo
Small hint from my side
git init : create empty repository and reinitialize an existing one
following link will give more information about different options can be used during git init ($GIT_DIR)
https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-init.html
I'm currently having an issue with my git submodule. I've created a git submodule in my cloned project folder and it appears right on my repo. But when I click on the symlink, it gives me Error 404 page not found. I am VS Code and Windows 8 x64. Thanks a lot for your help! Below is what is written in the .gitmodules
[submodule "themes/casper-two"]
path = themes/casper-two
url = "https://github.com/eueung/hugo-casper-two"
I cannot find the caa182b commit in the hugo-casper-two repository, so I believe you need to update the submodule to the latest commit available. To do this, run the following command from your project directory:
git submodule foreach git pull origin master
This command will update every submodule in your project and pull the latest commit from their master branch.
Remember to commit your own repository afterwards.
git commit -am "Pulled down updates to submodules"
I'm new to GitHub and I've searched a lot and tried this, this, this and this method but I'm still getting different errors. I've a project which has WatchKit extensions init. Now when I first created the project I didn't checked marked on Create a Git Repository. Now I want to upload the project to my git account. I have checked the following things:1: Xcode > Preferences > Source Control > And it is enabled.2: Source Control > Working Copies > Configure > Remotes > + > Then added the name and link created from my repo which I created online from my account. And it adds this automatically to all the three folders i.e. Project folder and Apple Watch Extension folders. But when I pust it from Source Control > Push it gave me this error Multiple errors occurred during the operation.3: I've tried doing it from terminal but after asking for my username and password I got remote: Repository not found. fatal: repository 'https://github.com/ibjects/My-App.git/' not found
So I have no idea where I'm doing wrong. And If I'm missing any information I'm ready to provide it as I don't know what else to mention.
Try to do it like this:
Go to the project folder in the terminal and run the command:
git init
Now add the remote URL :
git remote add origin your-url
Add everything to the git:
git add -A
commit the message:
git commit -m 'commit message'
push to the branch
git push origin master
I'm running Xcode 4.1 at work and home. I've successfully checked out a project from a remote svn repository (work) on my home setup. The repos was updated, so when I got home, I did an update on the local checkout.
The status of the updated files got flagged "U" (good) and a page appeared showing changes to accept, but when I hit accept, I get a popup that says:
The working copy "ABRA-D" failed to pull. fatal: Not a git repository
(or any of the parent directories): .git
Well, yes... the repo is svn, not git! Closing Xcode and restarting removes the "U" tags and I'm back where I started. Sounds like Xcode is confused about the repo type, though it knew enough to query the svn repo and find out what had been updated. Anyone know a cure?
That issue, already mentioned in "Error : Fatal: Not a git repository (or any of the parent directories): .git", has a somewhat curious solution described here:
Recently I created a new project and at some point I uploaded it to SVN. I am not quite sure how to reproduce this situation but somehow the versioning support of Xcode 4 decided to interpret the project as a git repository.
Each time I tried to copy a file per drag and drop into my project I got following error:
fatal: Not a git repository (or any of the parent directories): .git
The result was that the file got copied into the project folder, but the reference didn't get set in the project. I had to go into the folder and drag and drop the file again and uncheck the copy option this time, so that the reference gets set.
The Solution
Open Xcode and go to Window > Organizer
Find under repositories your project. It might be two entries if you use something like SVN.
Make sure it says "Type Git"
Mark the repository entry and hit backspace or delete (on mac)
Done
In my case, when i created my project it was using git. But later i removed all git files from my SVN repository. Then took an update.
Now, when i tried to add files, it gives me same error.
Solution: I removed all repositories against my project in XCode Organizer. Now when i added new files, it works fine.
I had a git and svn against the same project and tried removing the git and got this error
In the end went and manually edited xcshareddata found at and removed all the entries which had anything to do with the git repositoy.
myproject.xcodeproj/project.xcworkspace/xcshareddata