GitHub question - file permissions

Status
Not open for further replies.

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
So I'm working on a script to set up an iocage jail for Nextcloud: https://github.com/danb35/freenas-iocage-nextcloud

I've never used git before (other than doing the occasional git clone), and done almost nothing with github.com before. I wrote the starting script in a text editor on my Mac, uploaded it and the supporting files, and then have been making edits directly on the website. I'm sure there's a better workflow, but this is mine for now.

I'll git clone the repo onto a FreeNAS box, chmod +x the script, and run it. I'll then make a change on github.com and try to do git pull to update. And here's the problem--when I do the git pull, I get this:
Code:
From https://github.com/danb35/freenas-iocage-nextcloud
   af6e42e..e3b1493  master	 -> origin/master
Updating af6e42e..e3b1493
error: Your local changes to the following files would be overwritten by merge:
   nextcloud-jail.sh
Please commit your changes or stash them before you merge.
Aborting

...so I delete the file, do git pull again, chmod +x again, and I'm in business, but it'd be nice to just set the permissions on this file to be executable. What would be the easiest way to do this?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
This might help you:
It does, thanks--though it assumes a lot of knowledge (i.e., doing really anything with git at the command line) that I just don't have at this point. Oh hell, sleep is overrated...

Edit: ...or download the Github Desktop app for the Mac. Done.
 
Last edited:
Joined
Jul 10, 2016
Messages
521
The normal workflow is that you create an empty repository on github, then do a git pull to get a copy in your local file system. After you're done creating/editing/testing your scripts locally, you do git add git commit and git push it back to github.com. It is aware of the execution bit.

If you want to contribute to somebody else's repository, you have to fork. This is a pretty good how-to: https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project/
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Danke, Jurgen! But perhaps I should have been a bit clearer--not only have I not done anything significant with the git command, I've not done anything significant with any source code management system (damn it, Jim, I'm a lawyer, not a software developer). My concern was that (1) there would be a pretty steep learning curve, and (2) the inevitable mistakes would bork the repo.

For now, the Github Desktop app has done the trick. Installed that on my Mac, cloned the repo to the Mac, did chmod +x there, and used the desktop app to commit and push. I'm sure I should learn to do this at the command line (especially since I can't really test the code on the Mac), but this will do for now.
 
Status
Not open for further replies.
Top