« first day (262 days earlier)      last day (912 days later) » 

user435118
7:57 AM
@Makyen Is now ok to go through it? I already have git-gui installed.
 
@Xnero The sequence of commands I use is foobarCurrentBranch=`git rev-parse --abbrev-ref HEAD`; git fetch --all --prune; git checkout deploy; git reset --hard `git remote | grep -v origin`/deploy; git push origin deploy; git checkout master; git reset --hard `git remote | grep -v origin`/master; git push origin master; git checkout $foobarCurrentBranch
However, that sequence relies on having previously set up your GitHub repository as the origin and the Charcoal-SE repository as another remote repository. It also updates both the deploy and master branches (both are needed if you're running a SmokeDetector instanace out of your GitHub repository for testing).
The actual entry in my .gitconfig file is:
[guitool "sync master and deploy NO stash"]
	cmd = "foobarCurrentBranch=`git rev-parse --abbrev-ref HEAD`; git fetch --all --prune; git checkout deploy; git reset --hard `git remote | grep -v origin`/deploy; git push origin deploy; git checkout master; git reset --hard `git remote | grep -v origin`/master; git push origin master; git checkout $foobarCurrentBranch"
That can either be directly added to your .gitconfig file, or you can use the Git Gui user interface to add a tool with the portions that are enclosed in "".
 
user435118
@Makyen I haven't set up anything. What should I do first?
 
@Xnero You will need to clone your GitHub repository to a local directory.
 
user435118
@Makyen git clone?
 
@Xnero Yes, along with a reference to your repository, which may be a URL, or other reference. A URL can be obtained from the green "Code" button that is displayed when viewing the GitHub page for your repository.
 
user435118
8:09 AM
@Makyen It cloned into an undesired location, can I just move it?
 
@Xnero You should be able to just move the directory, as long as you're moving the whole directory.
 
user435118
@Makyen Done, what next?
 
8:24 AM
@Xnero You need to add the Charcoal-SE/SmokeDetector repository as an additional remote. You could do so with the command git remote add Charcoal-SE https://github.com/Charcoal-SE/SmokeDetector.git
 
user435118
fatal: not a git repository (or any of the parent directories): .git
 
user435118
@Makyen Done.
 
8:40 AM
@Xnero You then probably want to do git fetch --all
 
user435118
@Makyen Done.
 
@Xnero OK. The "sync master and deploy NO stash" sequence should now work. Ahh...wait. However, that sequence assumes you have not changed your GitHub repository's master branch to something which is not fast-forwardable to the HEAD of the main repository's master branch, but you have done so.
So, I suggest you create a new branch to mark/track the work you've already done in your GitHub repository's master branch. Doing so will make it so you don't loose easy access to the changes you've made in that branch when the master branch is changed to match the main repository.
 
user435118
@Makyen I haven't. I have a new fork. The master branch isn't ahead.
 
OK, then the sequence should work to update both the master and deploy branches in both your local and GitHub repositories to match the master and deploy branches in Charcoal-SE/SmokeDetector.
 
user435118
8:56 AM
@Makyen Do I need to change foobarCurrentBranch?
 
@Xnero No, that's just a variable name, which just needs to not be the same as any other variable you're using, in order to not interfere with whatever other use you may have. Hmmm... it does assume that grep is available in the path. It sort-of assumes that it's running under bash, but git bash is a "normal" part of a Windows git install.
 
user435118
@Makyen So what do I do? Add a tool?
 
@Xnero You can, if you want to be able to easily do it multiple times. If you just want to do it once, then you could open a Git Bash from Git Gui's "Repository" dropdown menu and then copy and paste the command into that (assuming you're not already running terminal based on bash.
You can do something very similar in other shells, including Windows' PowerShell, but the syntax for some commands may be a bit different
My personal choice was to add it as a tool.
Unfortunately, we've reached the point where I need to take off. I'll be gone for several hours.
 
user435118
@Makyen Ok, thanks for the help.
 
user435118
10:03 AM
@Makyen I'n trying to understand the commands and I get most of it but what does "git remote | grep -v origin/master;" do?
 
5:07 PM
@Makyen This message had multiple ` characters which were part of the series of commands, but which chat interpreted as Markdown formatting. Unfortunately, I did not notice that earlier and quote those characters in the Markdown. I've updated it so that it now appears to display correctly, which should be an exact match for the part in double quotes of the cmd line in my later message in that monologue which is completely code.
@Xnero Unfortunately, that portion the above message was a bit mangled when Chat converted from Markdown. That's actually git reset --hard `git remote | grep -v origin`/master. The portion within `` characters is run by the shell prior to the command line it's in and the result is used as part of the current command line. git remote will list all identifiers used for each remote repository.
git remote | grep -v origin will result in only retaining the remote which isn't "origin" (actually those remotes, but the code assumes 2). Given the intent is to synchronize to the other repository, this is a way to not hardcode the identifier for the other repository which isn't "origin". The code does, however, assume that there's a total of two remote repositories defined. It just doesn't require the other remote to have been given a specific identifier.
Enclosing that in `` causes the result of the command to be included as part of the command line, so the command that is part of becomes git reset --hard [the other remote repository's identifier]/master, which in this instance will be git reset --hard Charcoal-SE/master. IIRC, I changed that to not hardcoding the other remote identifier the last time we discussed this to accommodate the code being used by someone who had not made the same choice I had for the other remote's identifier.
 
user435118
5:31 PM
@Makyen The code still worked though which is good. Thanks for the explanation.
 
np
 
user435118
@Makyen The tool is quite useful, I just click it and it updates my fork.
 
@Xnero Yep. That's a good thing. :)
 
user435118
@Makyen Why did the code work if there were syntax errors?
 
@Xnero That's a good question. I haven't checked.
 
user435118
5:38 PM
@Makyen How do I see the code that the tool received?
 
@Xnero The code that will be run will be in your .gitconfig file. IIRC, that can be either, or both, at the repository level and/or within the user's home directory. On Windows, your "home" directory is one level up from your Documents folder.
 
user435118
@Makyen The folder which is supposed to contain the file is empty.
 
user435118
Seems like this might be helpful:
 
user435118
19
A: Cannot find gitconfig file

VonCAs confirmed by the OP, any git config --global command will create/update ~/.gitconfig. But as it is an hidden file by default, you would need a ls -alrt to see it. git config --global -l will list its content. More generally, git config --list --show-origin shows all config files (and each li...

 
user435118
@Makyen Every time I open command prompt I have to CD to SmokeDetector and the path is not the shortest. Is there any way to make that quicker e.g. to create a shortcut CD'd to that path without obviously keeping it open?
 
user435118
5:45 PM
`git rev-parse --abbrev-ref HEAD; git fetch --all --prune; git checkout deploy; git reset --hard git remote | grep -v origin/deploy; git push origin deploy; git checkout master; git reset --hard git remote | grep -v origin`/master; git push origin master; git checkout $foobarCurrentBranch
 
@Xnero Yes, but how to do it will depend on which shell you're using, your operating system, etc. There should be numerous questions/answers on a few/several SE sites which cover the various possibilities.
 
user435118
@Xnero cc @Makyen Weird how the code worked with incorrect syntax. It did return one or two fatal's though if that's related.
 
@Xnero That it worked is likely at least partially a result of the existing state of your repository. I'd have to take a more detailed look to see exactly what's going on.
 
user435118
@Makyen Should I replace the tool with the new code?
 
@Xnero I would, or just directly edit the .gitconfig file (once you find it) and restart Git Gui.
 
user435118
6:00 PM
@Makyen I can't seem to edit the file, I'll just redo the tool.
 
user435118
@Makyen Are the speechmarks at the end intentional?
 
7:00 PM
@Xnero I'm unsure what you're asking. If you're entering that command into the Git Gui tool interface, there are no double quote marks (") involved. The double quotes only exist in the .gitconfig file to indicate what the text of the command is.
 
 
1 hour later…
user435118
8:15 PM
@Makyen Nevermind, it worked without the quotes. Thanks again.
 
8:25 PM
@Xnero np
 
user435118
8:36 PM
@Makyen Do you think it’s too soon to enquire about blacklist manager privileges? I don’t want to be pushy and it’s been nearly 3 weeks since I last enquired. It’s just I don’t want others to be annoyed as I had over 10 watch PRs today.
 
@Xnero I wouldn't inquire at all. People getting annoyed at having to review and (almost always) approve blacklist PRs is the primary way that it's determined that it's time to give the user that privilege.
 
user435118
@Makyen Ok.
 

« first day (262 days earlier)      last day (912 days later) »