I have some troubles with Github:
When I am pushing my Xcode project to github, it seems that it won't push all files regarding the pods and app extensions because when I pull the project down on my other mac, I get a whole lot of errors that is not there on the original file.
Thanks in advance!
After a lot of testing I found the answer. When I used the command lines in terminal for pushing the project to Github, instead of the shortcuts in Xcode, I saw that this files were not "added" to the committing (I checked this by typing: git status). Then all I had to do was to write in Terminal: git add -A to add all the files. I committed and pushed them to Github, and now everything is working fine!
Thanks for all the help I got!
As shallowThought is suggesting, extend your question with your .gitignore file, so we can identify the lines that are likely preventing git from tracking the pods and extensions.
If you are unsure how to find and copy this .gitignore file, do the following:
In Xcode, on the left open the Project Navigator (folder icon) & select your project (usually the top item in the list).
From the File Menu, choose Show in Finder.
Finder will open with <your-project>.xcodeproj selected. If you don't see the folder that contains <your-project>.xcodeproj, press ⌘ 3 to tell Finder to View as Columns.
De-select <your-project>.xcodeproj and instead drag the folder that contains it onto the Terminal icon (usually in the bottom of the screen). If Terminal was not there, first start Terminal; e.g. by pressing ⌘ Space and typing Terminal.
Now, Terminal is showing the commandline in the same place where your .gitignore file usually is—technically it can be in any subfolder.
Type pbcopy < .gitignore followed by Enter to copy the contents of the file in your clipboard.
… now post the contents in your question.
Another way to check if indeed git is not tracking your desired files is opening Terminal, and running the following command (from this answer): git ls-tree -r HEAD --name-only
If Git is not tracking the files that you require, they will not be in the list.
If you want to solve this yourself, your best bet is to remove the line from the .gitignore file that is preventing Pods etc. to be tracked. So, you're are actually doing the opposite of this SO answer ;-)
In step 3. type open -a "TextEdit" .gitignore followed by Enter to open the file.
Then remove the line(s) that you don't want ignored. Save. Now you can add/commit/push the files to GitHub.
Related
So I submitted a line on Git Bash "touch README.txt -m '...asdf ... qwer...' " attempting to create a readme file with text inside (I'm obviously new to this haha). The result was an empty README.txt file and a random file titled '...asdf ... qwer...' with filetype "file" that I can't get rid of. When I try to delete or alter it, a window pops up that says "Could not find this item. ... This is no longer located in [location]. Verify the location and try again." The Git GUI doesn't seem to recognize it either and I can't delete the parent directory. Command line deletion (del /r /q "...") was unsuccessful. Tried rebooting as well to see if it disappeared. It is not a hidden file.
What exactly happened here and how do I get rid of it? Thanks!
I had a similar issue trying to delete a file that "no longer existed" on my Windows 10 PC. What worked for me was adding the problem file(s) to an archive and ensuring the option, "Delete files after compression" (or equivalent option) in the archive software was ticked. Once the archive process completed, the problem file disappeared from the folder. I then deleted the archive file and everything was good to go.
To add the file to an archive make sure you have something like 7-Zip or WinRAR installed. Here's an example using 7-Zip:
Right-click the problem file and select "7-Zip" from the context menu followed by the "Add to archive" option.
In the "Add to Archive" dialogue, tick the "Delete files after compression" option.
Select the OK button.
The problem file will disappear and an archive file will appear in your folder in its place (hopefully!).
Delete the archive file.
Hope this works for you too.
I am setting up my first project in Git. How do I setup git-ignore file in Windows?
I am creating my first Rails project using Vagrant and trying to configure .gitignore in Windows
Easy.
Make a file .gitignore using your text editor
In there, write the file name you'd want to ignore
You can use wildcard like: *.pyc ignoring any file with extension .pyc
If you use TortoiseGit or other Git software, it will be easier. There will be add to ignore list menu when you right click to a file.
It seems that for ignoring files and directories there are two main ways:
.gitignore
Placing .gitignore file into the root of your repo besides .git
folder (in Windows make sure you see the true file extension and then
make .gitignore.
Making global configuration %HOMEPATH%\.gitignore_global and running
git config --global core.excludesfile %HOMEPATH%\.gitignore_global
to add this to your git config.
Note: files tracked before can be untracked by running git rm --cached filename. This absolutely critical for repos that existed BEFORE you created the .gitignore
Repo exclude
For local files that doesn't need to be shared, you just add file pattern or directory to file .git\info\exclude. These rules are not committed, so are not seen by other collaborators in your project. These are machine specific configs.
Windows does not allow you to create a "dotfile" (i.e., a file whose name begins with a dot). There are three simple ways to create a .gitignore in Windows, though. In each case, you want the .gitignore in your project's root directory.
In your text editor, create a file and "Save" or "Save As". Name the file ".gitignore" and the text editor works around the OS's limitation. I use Sublime Text 3 and Vim. This method works for both (Vim would use the command :w, though).
A fallback would be to create an empty (for now) text file and save it as .gitignore.txt then go into the command shell and rename the file to .gitignore (using the command line). That will do it.
Git Bash (available in the git installer for Windows) has the "touch" command and it will create dotfiles. At the Git Bash prompt enter the command "touch .gitignore" and an empty file is created if no file existed with that name.
Add your exclusion rules inside the .gitignore file:
Starting point. This repo will give you sample exclusion patterns for (i) Windows, (ii) Rails and (iii) Vagrant. You could add those to a global gitignore file.
GitIgnore / Patterns. This section of the Git Manual explains the patterns to use in your new gitignore file. Basically, you exclude directories and files that don't need version control.
To add to previous answers that you should use a text editor to create the .gitignore file, I usually first run dir > .gitignore from a Windows command prompt or Powershell window.
This outputs the entire directory listing to a file named .gitignore .
Then it's very easy to use a text editor (e.g., Notepad ++ or Atom) to modify the file from the directory listing and not miss a file or mistype a file name.
For Windows 10 I used:
ls > .gitignore
to create a clean .gitignore file ready to just delete lines where using 'dir' I would have had to also edit out all the explanatory directory text. I needed this when vscode told me I had 5K changes after I added a virtual environment to an existing project.
I've been trying for literally hours to set a global alias that I can use when I open Git bash on my Windows machine to cd to a specific location.
I want to be able to simply type the alias to get to the location. I've tried every which way. The attempt that got me closest was based on this: https://superuser.com/questions/602872/how-do-i-modify-my-git-bash-profile-in-windows
...but it seems that to get it to work upon relaunching of bash, I have to use source .bashrc, which I don't want to do. Help appreciated.
I just jury rigged a solution with a simple shell script that acts like a global alias. If someone has a better solution, please do tell.
Opened text editor and wrote the following two lines:
#!/bin/bash
cd blah/blep/directory_of_choice
Saved it as a text file with a descriptive name (like dirjump) somewhere and copied it.
In file explorer, navigated to the bin folder in the MinGW64 installation, e.g. "C:\Program Files\Git\mingw64\bin"
Pasted the file into this bin folder.
While viewing the contents of the bin folder referenced above in Windows file explorer, from the menu bar selected "view > options", which opened the "folder options" dialog. Selected the "view" tab here and unchecked "Hide extensions for known file types" and clicked ok.
Deleted the ".txt" extension from the file copied into the bin folder.
To call this shell script that has the same result as a global alias, typed the following in Git bash:
. dirjump (the space between the dot and the dirjump MUST be included)
This might be a silly question, but can we prevent the displaying of old references in the project list view? I see files that were deleted but still show with an "X" icon. I wish I could attach a screenshot.
As per the comments, this is a git issue, and not a textmate issue.
Try this:
$ git commit -a -m "git comment"
$ git push origin master
According to the OP, this will also work:
$ git add -A
Reference:
Textmate 2 Alpha showing references for deleted files
I use TortoiseGit 1.8.3.
I changed one of the files: Makefile, but I want to not offer commit it to me every once in a Git Commit.
I added it to the "delete and add to ignore list", but it does not help.
How do I make to some of the files that I have changed is not offered in the commit?
I want, that Makefile was in remote repository as read-only, that I could edit it locally, and then TortoiseGit does not offer to me to commit it.
That I wanted for Git-bash: https://www.kernel.org/pub/software/scm/git/docs/git-update-index.html
Answer for TortoiseGit 1.8.15, Git 2.6.1. There is no need to revert to the command line, all functions are directly available in TortoiseGit. I've tried to summarize the various ways how this function is accessible.
I assume that the reader knows what "assume unchanged" means. Here is easy documentation about this feature. Or the original documentation about --assume-unchanged or git ls-files.
Flag a file as "assume unchanged"
There are three possibilities in TortoiseGit: in the Commit dialog, the Working Tree dialog (Check for Modifications) or in the Log Messages dialog (only when Working dir changes entry is selected). From one of these dialogs do the following:
right-click the file and select the entry Assume Unchanged
From any file list in Windows Explorer do the following:
right-click the file and select properties
go to the Git tab
tick the entry Assume valid/unchanged
Remove the "assume unchanged" flag from a file (undo the above):
TortoiseGit allows to remove the flag only from the Working Tree dialog (check for Modifications).
in the lower left corner of the dialog: make sure to tick the option Show ignore local changeds flagged files
all files with assumed valid or skip worktree flag will be shown below the normal changed files
right-click on the file and select Unflag as skip-worktree or assume-unchanged
From any file list in Windows Explorer do the following:
right-click the file and select properties
go to the Git tab
untick the entry Assume valid/unchanged
If I'm interpreting the question correctly, Alex wants to know how to undo an --assumed-unchanged action done using Tortoise Git.
You don't need to use command line Git to fix this:
Navigate to the file(s) you did this action on in windows explorer,
Right-click and choose Properties,
Select the Git tab, there you should see a checked box next to "Assume valid/unchanged".
Uncheck it and it won't be ignored by commits moving forward.
The approved answer is good but in case you're hunting for the dialogues and options here you have a short help:
If it doesn't help, then you need to go to a command-line interface, and check:
the content of the .gitignore file that you should find at the root directory of your repo (as mentioned in "TortoiseGit: hide/remove files never to be versioned")
the result of git rm --cached Makefile.
the result of git status.
I want, that Makefile was in remote repository in read-only, that I could edit it localy, and then TortoiseGIT does not offer to me to commit it.
This is different:
You need:
git update-index --really-refresh --no-assume-unchanged Makefile
That will make any local modification to Makefile "invisible" to git, while keeping Makefile under source control.
If you want your local modifs to resist a git reset, do;
git update-index --skip-worktree Makefile