GitHub for Mac app memory expansion freezes GitHub app - macos

When I try to launch GitHub for Mac it immediately starts using up all of the free memory (as much as 1.6 Gb) until the application freezes. How can I limit the memory usage for this app?
I saw a previous stackoverflow post (titled 'Memory Issues for Mac App') that touched on this issue, and I've updated my .gitconfig file, but it isn't having any effect. It's not clear if if the app is even reading the config file or how it would be possible to determine whether it is or not.
Any suggestions?

My suggestion for git is to use it from the command line. It was designed for use from the command line. By not using it from the command line, you lose the following:
command history
scriptability
piping
tab-completion
lots of help and examples online
The first is a big one. You will ask yourself "What did I do to create a branch with tracking of another one?". On the command line you can hit ctrl-R and type "branch". Hit ctrl-R a few more times to iterate over each occasion that you used git branch. You will find what you did when you made that branch. Pressing up and down arrows will scroll you through previous and subsequent commands that you issued. You can even add the time and date into history and when you list the history you can see exactly when you did something.
Scripts are very useful for things you do repeatedly and the same tasks are tedious when done manually through the gui.
Piping is very useful as you can alter results from one command and pass them to another. Something I do quite often is
git branch |
grep 'filter for what I need' |
sed 'some funky transformation' |
xargs -n 1 -i{} git push -u centralrepo {}:public/{}
It's a made up example of how you might string together a few commands to automate some very time consuming task.
Tab-completion is great as it saves you time for having to hunt around for what branch exists or what file exists. It is context sensitive so when git expects a file to be listed, tab will fall through and start matching files underneath. When it's expecting a remote name, hitting tab a couple of times will get you a list of remote repositories. Partially typed branches or files or remote will get you a subset when you hit tab twice.
Getting help with git is important. It's got a steep learning curve. The majority of git's use is from the command line. So when you run into issues, google is very good at finding a solution quickly. Other git tools don't have this luxury and you may find yourself wasting quite a lot of time to find answers.

Related

Restoring an Xcode commit that was never pushed to Github

This is a question that I posted, and then after much digging finally resolved myself. There is actually quite a bit on this subject both on this forum and elsewhere, but it usually requires some familiarity with Terminal. I am going to describe the problem I faced and then describe step-by-step in detail (at a beginner's level) how to resolve the issue in Terminal.
In short, I checked out a previously committed version of my app in Xcode, which - because it was a version from several weeks prior - did not contain my most recent commits. In other words, I had no access to any of the commits that contained my most recent work. They had all disappeared.
My commits and pushes had not stored in GitHub because presumably some time before this I had accidentally selected my main folder as the destination for my commits, rather than one of the two branches I created. So I had absolutely no access to my work. By all appearances I pretty much had to start from scratch.
After much hand wringing, teeth gnashing, and hours of scouring the webs, I finally uncovered the solution. But it takes a bit of understanding about Terminal to make it work. So after several more hours of learning Terminal, I finally successfully restored all of my work.
For any of you who are new to coding (as I am), and who have no experience with Terminal, I will provide detailed instructions on how to resolve this issue if you encounter it in the answer below.
Open Terminal to prompt to your Xcode project. The easiest way to do this is to find your project in Finder, which will have a .xcodeproj extension, and then right click it.
Select New Terminal at Folder.
At this point, a terminal window will pop up. From here, enter the following: git reflog
Press Enter
This will populate a list of all the commits stored in your Xcode project. Each commit is identified by an alphanumeric code (the one I restored was 1a7ea33, for example).
Note the alphanumeric code of the commit you wish to restore.
After this, enter the following: git checkout -b NewBranch 1a1a1a1 (where "NewBranch" is whatever name you decide to name your new branch, and "1a1a1a1" is your alphanumeric code from steps 5 and 6).
Press Enter.
That's it. Close Terminal and open your Xcode project as normal. You will notice the restored commit in the folder you just named in Terminal.
Hopefully no one will ever need this, but if by chance someone does I hope it helps.

Apple File System (APFS) Check if file is a clone on Terminal (shell)

With macOS High Sierra a new file system is available: APFS.
This file system supports clone operations for files: No data duplication on storage.
cp command has a flag (-c) that enables cloning in Terminal (shell).
But I didn't find a way to identify theses cloned files after.
Somebody knows how to identify cloned files with a shell command, or a flag in a existent command, like ls?
After 3 years and 2 months... I received a lot of points because of this question here on stackoverflow.
So yesterday I decided to revisit this topic :).
Using fcntl and F_LOG2PHYS is possible to check if files are using same physical blocks or not.
So I made an utility using this idea and put it on github (https://github.com/dyorgio/apfs-clone-checker).
It is only the first release guys, but I hope that the community can improve it.
Now maybe a good tool to remove duplicated files using clone APFS feature can be born. >:)
The command you have used, is not a feature of APFS-Filesystem. The CP -c command calls a function named "clonefile" which is part of bsd since 2015 (s. Man-Page)
http://www.manpagez.com/man/2/clonefile/
So if you clone a file for example, you can change attributes from Original and the Clone can have diffrent Attributs.
I think, the Feature, you are searching for is build in per Copy and Write. You can see the different, if you make a clone with Time Machine.
A have not found a commando per Terminal today, to show this differences, but the clonefile command therefore is not the right function.
The only Known-Way today to Show changed Attributes in Clones is Apple Time Machine Backup Solution.
It`s a Snapshot Solution. Something about this, in this Apple Dev Support-Case:
https://forums.developer.apple.com/thread/81171
I think this is meant to be an internal proprietary feature of APFS that you are not supposed to be playing with. It strikes me as a relatively useless feature. If you want to have two files that are the same and use standard APIs, try either hard or soft links, or else Apple aliases.

Bash & SVN: How to handle when the SVN command wants user feedback?

So, I'm working on a bash script to manage some of my version control commands that I've been doing manually via the command line. It's a long story why I'm doing this, and not just using one of the SVN tools out there. Short answer: I'm using both Git and SVN, with the same codebase, but for different purposes. These scripts allow me to execute all the commands at once.
Anyway, I've got the script going great. Everything works perfectly. My one concern is the times that SVN prompts the user for input. The big one I'm thinking about is merge conflicts. Whenever there's a conflict when its downloading files from the server, it prompts the user to take action about that conflict.
Ideally, I want to suppress all output from the SVN command during execution, and if there are merge conflicts, just postpone them and then tell the user at the end that such conflicts exist (the user can then go in and resolve them).
So, for the question: Is there a way to use bash to handle those user input prompts. To detect them, respond to them, and keep the process going?
For the sake of argument, let's work off of this simple SVN command. Assume that this command is in a Bash script, and when it is executed there is a merge conflict. What, if anything, can I do?
svn update .
Thanks in advance.
I use the
svn update my_checkout_path --accept postpone --config-option config:miscellany:preserved-conflict-file-exts=*
Where --accept postpone is to skip all auto conflict operations, and preserved-conflict-file-exts is to dissallow auto merge for all files.
Read more:
http://svnbook.red-bean.com/en/1.8/svn.tour.cycle.html#svn.tour.cycle.resolve.pending
http://svnbook.red-bean.com/en/1.8/svn.advanced.confarea.html
Update
To detect the conflict situation you can look for Summary of conflicts string in update output (if you sure you have use the english version).

Why do long results from Git commands kill my PowerShell prompt?

I am using Git Shell (the module for PowerShell) on Windows. It's the one that got installed when I installed Git for Windows. When I run a command that results in a lot of text such as git log I get a page of results and then a ":" at the bottom of the screen. I guess it's a continuation prompt because I press ENTER and get another screen of data. I can't usually recover to a normal prompt after this happens though. I get the text (END) at the bottom of the shell and it looks like it's masking the first few characters of whatever command I try to type and it even seems to act a little sporadic. I can't seem to figure it out. Any ideas?
Several of the git commands use a pager to allow you to view one screen full of information at a time. The one that come with git is usually less (more info). You can visit the link for common commands, but as you've found the most important is q to quit to get back to the command prompt. The next most useful one I've found is space to move to the next screen full.
You can change the pager used if you like in the git config file's core.pager field.
Just to add to the existing answers, the normal "windows" pager is more.com, which is usually referenced from cmd as simply more, but hidden by the function more with similar functionality in PowerShell. If you set
git config --global core.pager more.com
your problems should go away (although at the cost of features that exist in less but not more).
This is an old question, but I thought I would mention that git also provides a --no-pager option for you to leverage as well.
git --no-pager log
Hope that helps someone.

Using SVN for the first time

Not sure if I should be asking here or Server Fault.
Anyhow, I recently started a project at a new job that has SVN installed. I didn't use it even though I was given SSH access with some keygen thing. But now I've done some reading online for beginner's and I'm having a tough time getting past "which svn" after I input a command through SSH. I guess that tells me the path to the repository (which is /usr/bin/svn) but I don't even know how to get to that directory (I'm using Terminal on Mac OS X).
All this makes me feel pretty stupid, since I've never really had to use the terminal to do web projects before and this is my first experience with SVN via SSH (Hell, first time using SSH even).
I have been googling and reading for a weekend now, but I figured someone on here probably has a good idea of where to find the files or to check which are under SVN etc. I think my main problem is finding out how to use the terminal to "get" to the folder I want to be working on.
I did read up on the commands to check if a file is under SVN, check out, update, commit, etc. I would just like to know how to get to these files to do that. Sorry for the noob question and thanks in advance
Bonus points if someone explains the benefits of SSH (I totally understand the benefits of SVN and would love to learn it properly)
You're likely better off using a subversion client. Two of the most popular ones for OS X are http://versionsapp.com and http://zennaware.com/cornerstone/index.php (lately my dev friends seem to like cornerstone more.)
These should let you do all (or nearly all) SVN functions, but by using a GUI. You'll still want to learn the terminology. Take a look at http://svnbook.red-bean.com/en/1.6/svn.basic.html
You want SVN+SSH as it's more secure, but that shouldn't mean you have to use the command line.
Well there is no need to go to the /usr/bin even though svn resides there. /usr/bin is a standard location which is automatically included when the system tries to resolve the location of a file. You should be able to just start using SVN commands like:
svn checkout ...
The benefits of using SVN and SSH are separate questions all together.
svn list --verbose http://host_name/svn_dir will give you a list of the current versioned projects (including revision number and modified date)
svn checkout http://host_name/svn_dir/repository_name projectx will checkout the repo (creating a working copy on your local machine)
I'd recommend the manual here, even if you don't read it to start with and just use it as your first reference point when needed.

Resources