Ich bin auf der Suche nach Hilfe, bitte benutze Emacs/Magit, um die lokalen Repository-Änderungen auf die Remote-Website und Github auf einen Schlag zu übertragen.Emacs - Wie man ein Git-Repository auf mehrere Fernbedienungen pusht
Ich fand einen nicht-Emacs/nicht-Magit verwandten Thread (https://stackoverflow.com/a/3195446/2112489), mit Kommentaren, dass es die definitive Antwort auf das Drücken auf eine Fernbedienung und Github ist, und es hat ein paar hundert Daumen hoch. Ich nehme an (vielleicht falsch), das ist ein guter Ausgangspunkt für die lokale.gitconfig
Datei im Verzeichnis $HOME
auf meinem Computer.
[remote "GitHub"]
url = [email protected]:elliottcable/Paws.o.git
fetch = +refs/heads/*:refs/remotes/GitHub/*
[branch "Master"]
remote = GitHub
merge = refs/heads/Master
[remote "Codaset"]
url = [email protected]:elliottcable/paws-o.git
fetch = +refs/heads/*:refs/remotes/Codaset/*
[remote "Paws"]
url = [email protected]:Paws/Paws.o.git
fetch = +refs/heads/*:refs/remotes/Paws/*
Der grundlegende Befehl Push-in Emacs/Magit schiebt nur einer nach dem anderen:
C-u P P [and then use arrow keys to select from the choices in the minibuffer] RET
Siehe Magit Spickzettel der verfügbaren Befehle: http://daemianmack.com/magit-cheatsheet.html
Vorläufiger Denken - Verwenden Sie /usr/local/git/bin/git remote -v
, um eine Liste der bereits konfigurierten Fernbedienungen zu erhalten d Verwenden Sie dann die Ergebnisse, um zu jedem einzelnen zu gelangen. . . machbar, aber komplex.
$ MP:my_project.git HOME$ /usr/local/git/bin/git remote -v
origin [email protected]:lawlist/my_project.git (fetch)
origin [email protected]:lawlist/my_project.git (push)
remote_website [email protected]:my_project.git (fetch)
remote_website [email protected]:my_project.git (push)
COMMAND-LINE RECIPE - separat an die Fern schieben und zu Github:
;; Setup the remote repository and the hook; and the remote destination folder.
ssh [email protected]
mkdir /home/lawlist/my_project.git
cd my_project.git
git init --bare
;; git update-server-info # If planning to serve via HTTP
cat > /home/lawlist/my_project.git/hooks/post-receive ;; RET
#!/bin/sh ;; RET
GIT_WORK_TREE=/home/lawlist/my_project git checkout -f ;; RET
;; C-d
chmod 755 /home/lawlist/my_project.git/hooks/post-receive
mkdir /home/lawlist/my_project
exit
;; On local machine.
mkdir /Users/HOME/.0.data/.0.emacs/elpa/my_project.git
touch /Users/HOME/.0.data/.0.emacs/elpa/my_project.git/README.md
cd /Users/HOME/.0.data/.0.emacs/elpa/my_project.git
/usr/local/git/bin/git init
/usr/local/git/bin/git add .
/usr/local/git/bin/git commit -m "First commit."
curl -u lawlist:12345678 https://api.github.com/user/repos -d '{"name":"my_project.git"}'
/usr/local/git/bin/git remote add origin [email protected]:lawlist/my_project.git
/usr/local/git/bin/git remote add remote_website [email protected]:my_project.git
/usr/local/git/bin/git push origin master
/usr/local/git/bin/git push remote_website master
;; For modification of local files
/usr/local/git/bin/git add .
/usr/local/git/bin/git commit -m "This is a modification . . . ."
/usr/local/git/bin/git push origin master
/usr/local/git/bin/git push remote_website master
+1 Danke für das Teilen! – itsjeyd