Git
GitHub
2023-04-03
# rename branch 'master' to 'rawhide' (on GitHub) git branch -m master rawhide git fetch origin git branch -u origin/rawhide rawhide git remote set-head origin -a
2021-11-25
https://github.com/{owner}/{repo}/archive/{ref}.tar.gz https://github.com/{owner}/{repo}/archive/{ref}.zip
|
https://github.com/{owner}/{repo}/tarball/{ref} https://github.com/{owner}/{repo}/zipball/{ref}
|
$ wget https://github.com/xrootd/xrootd/archive/master.tar.gz --2021-11-24 17:24:40-- https://codeload.github.com/xrootd/xrootd/tar.gz/master 2021-11-24 17:24:41 (5.01 MB/s) - ‘master.tar.gz’ saved [3109178] $ tar -tzf master.tar.gz | head -1 xrootd-master/ |
$ wget https://github.com/xrootd/xrootd/tarball/master --2021-11-24 16:50:30-- https://codeload.github.com/xrootd/xrootd/legacy.tar.gz/master 2021-11-24 16:50:31 (6.19 MB/s) - ‘master’ saved [3109792] $ tar -tzf master | head -1 xrootd-xrootd-6f72836/ |
$ wget https://github.com/xrootd/xrootd/archive/v4.12.8.tar.gz --2021-11-24 17:30:48-- https://codeload.github.com/xrootd/xrootd/tar.gz/v4.12.8 2021-11-24 17:30:49 (5.73 MB/s) - ‘v4.12.8.tar.gz’ saved [2615174] $ tar -tzf v4.12.8.tar.gz | head -1 xrootd-4.12.8/ |
$ wget https://github.com/xrootd/xrootd/tarball/v4.12.8 --2021-11-24 16:51:56-- https://codeload.github.com/xrootd/xrootd/legacy.tar.gz/v4.12.8 2021-11-24 16:51:57 (6.01 MB/s) - ‘v4.12.8’ saved [2615393] $ tar -tzf v4.12.8 | head -1 xrootd-xrootd-58898a7/ |
$ wget https://github.com/root-project/root/archive/v5-34-00-patches.tar.gz --2021-11-24 17:10:32-- https://codeload.github.com/root-project/root/tar.gz/v5-34-00-patches 2021-11-24 17:10:38 (11.7 MB/s) - ‘v5-34-00-patches.tar.gz’ saved [75603149] $ tar -tzf v5-34-00-patches.tar.gz | head -1 root-5-34-00-patches/ |
$ wget https://github.com/root-project/root/tarball/v5-34-00-patches --2021-11-24 17:09:42-- https://codeload.github.com/root-project/root/legacy.tar.gz/v5-34-00-patches 2021-11-24 17:09:49 (12.0 MB/s) - ‘v5-34-00-patches’ saved [75607400] $ tar -tzf v5-34-00-patches | head -1 root-project-root-36f558c/ |
$ wget https://github.com/musinsky/config/archive/6488e91.tar.gz --2021-11-25 15:17:09-- https://codeload.github.com/musinsky/config/tar.gz/6488e9112f3329a09ee79d9a476c2edd5f5f6165 2021-11-25 15:17:10 (11.0 MB/s) - ‘6488e91.tar.gz’ saved [2634769] $ tar -tzf 6488e91.tar.gz | head -1 config-6488e9112f3329a09ee79d9a476c2edd5f5f6165/ |
$ wget https://github.com/musinsky/config/tarball/6488e91 --2021-11-25 15:20:12-- https://codeload.github.com/musinsky/config/legacy.tar.gz/6488e9112f3329a09ee79d9a476c2edd5f5f6165 2021-11-25 15:20:13 (8.90 MB/s) - ‘6488e91’ saved [2634725] $ tar -tzf 6488e91 | head -1 musinsky-config-6488e91/ |
pred
2020-05-03
- reset repo do povodneho stavu, resp. ako je na origin=github.com
git fetch origin # checking github git reset --hard origin/master git clean -n -d # dry-run git clean -f -d git status --ignored git clean -n -x -d # dry-run git clean -f -x -d
2023-11-21
2019-03-22
[musinsky@strela ~]$ git clone git@github.com:musinsky/root.git Cloning into 'root'... [musinsky@strela root]$ git status On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean [musinsky@strela root]$ git remote -v origin git@github.com:musinsky/root.git (fetch) origin git@github.com:musinsky/root.git (push) [musinsky@strela root]$ git remote add upstream https://github.com/root-project/root.git [musinsky@strela root]$ git remote -v origin git@github.com:musinsky/root.git (fetch) origin git@github.com:musinsky/root.git (push) upstream https://github.com/root-project/root.git (fetch) upstream https://github.com/root-project/root.git (push) [musinsky@strela root]$ git branch * master [musinsky@strela root]$ git fetch upstream remote: Enumerating objects: 11893, done. remote: Counting objects: 100% (11893/11893), done. remote: Compressing objects: 100% (40/40), done. remote: Total 38637 (delta 11862), reused 11865 (delta 11852), pack-reused 26744 Receiving objects: 100% (38637/38637), 34.84 MiB | 22.59 MiB/s, done. Resolving deltas: 100% (27000/27000), completed with 2554 local objects. From https://github.com/root-project/root * [new branch] master -> upstream/master * [new branch] v5-34-00-patches -> upstream/v5-34-00-patches * [new branch] v6-06-00-patches -> upstream/v6-06-00-patches * [new branch] v6-08-00-patches -> upstream/v6-08-00-patches * [new branch] v6-10-00-patches -> upstream/v6-10-00-patches * [new branch] v6-12-00-patches -> upstream/v6-12-00-patches * [new branch] v6-14-00-patches -> upstream/v6-14-00-patches * [new branch] v6-16-00-patches -> upstream/v6-16-00-patches * [new tag] v3-10-02-patches -> v3-10-02-patches * [new tag] v4-00-08-patches -> v4-00-08-patches * [new tag] v4-03-04-patches -> v4-03-04-patches * [new tag] v4-04-02-patches -> v4-04-02-patches * [new tag] v5-08-00-patches -> v5-08-00-patches * [new tag] v5-10-00-patches -> v5-10-00-patches * [new tag] v5-12-00-patches -> v5-12-00-patches * [new tag] v5-13-04-patches -> v5-13-04-patches * [new tag] v5-14-00-patches -> v5-14-00-patches * [new tag] v5-18-00-patches -> v5-18-00-patches * [new tag] v5-20-00-patches -> v5-20-00-patches * [new tag] v5-22-00-patches -> v5-22-00-patches * [new tag] v5-24-00-patches -> v5-24-00-patches * [new tag] v5-26-00-patches -> v5-26-00-patches * [new tag] v5-27-06-patches -> v5-27-06-patches * [new tag] v5-28-00-patches -> v5-28-00-patches * [new tag] v5-30-00-patches -> v5-30-00-patches * [new tag] v5-32-00-patches -> v5-32-00-patches * [new tag] v6-00-00-patches -> v6-00-00-patches * [new tag] v6-02-00-patches -> v6-02-00-patches * [new tag] v6-04-00-patches -> v6-04-00-patches * [new tag] v6-13-04 -> v6-13-04 * [new tag] v6-13-06 -> v6-13-06 * [new tag] v6-13-08 -> v6-13-08 * [new tag] v6-14-00 -> v6-14-00 * [new tag] v6-14-00-rc1 -> v6-14-00-rc1 * [new tag] v6-14-02 -> v6-14-02 * [new tag] v6-14-04 -> v6-14-04 * [new tag] v6-14-06 -> v6-14-06 * [new tag] v6-14-08 -> v6-14-08 * [new tag] v6-15-02 -> v6-15-02 * [new tag] v6-16-00 -> v6-16-00 * [new tag] v6-16-00-rc1 -> v6-16-00-rc1 [musinsky@strela root]$ [musinsky@strela root]$ git fetch upstream [musinsky@strela root]$ ls tutorials/tree/temperature_Prague.dat ls: cannot access 'tutorials/tree/temperature_Prague.dat': No such file or directory [musinsky@strela root]$ git branch * master [musinsky@strela root]$ git checkout master Already on 'master' Your branch is up to date with 'origin/master'. [musinsky@strela root]$ git merge upstream/master Updating 1915926942..95d76220cf Fast-forward .ci/copy_headers.sh | 24 + .ci/format_script.sh | 22 + .ci/tidy_script.sh | 34 + .github/CODEOWNERS | 18 +- .gitignore | 9 +- .mailmap | 146 + .travis.yml | 168 +- CMakeLists.txt | 220 +- README.md | 23 +- README/CREDITS | 28 +- [musinsky@strela root]$ ls tutorials/tree/temperature_Prague.dat tutorials/tree/temperature_Prague.dat [musinsky@strela root]$ git branch * master [musinsky@strela root]$ git fetch upstream [musinsky@strela root]$ git merge upstream/master Already up to date. [musinsky@strela root]$ git remote -v origin git@github.com:musinsky/root.git (fetch) origin git@github.com:musinsky/root.git (push) upstream https://github.com/root-project/root.git (fetch) upstream https://github.com/root-project/root.git (push) [musinsky@strela root]$ git push origin master Warning: Permanently added the RSA host key for IP address '140.82.118.3' to the list of known hosts. Enumerating objects: 35690, done. Counting objects: 100% (35690/35690), done. Delta compression using up to 4 threads Compressing objects: 100% (12129/12129), done. Writing objects: 100% (33770/33770), 28.07 MiB | 4.38 MiB/s, done. Total 33770 (delta 23493), reused 30968 (delta 21019) remote: Resolving deltas: 100% (23493/23493), completed with 1667 local objects. To github.com:musinsky/root.git 1915926942..95d76220cf master -> master [musinsky@strela root]$ git push origin master Everything up-to-date [musinsky@strela root]$ # dir resp. repo z hore uvedeneho prikladu [musinsky@strela root]$ git checkout<TAB> Display all 408 possibilities? (y or n) [musinsky@strela root]$ git checkout upstream/<TAB> upstream/master upstream/v5-34-00-patches upstream/v6-06-00-patches upstream/v6-08-00-patches upstream/v6-10-00-patches upstream/v6-12-00-patches upstream/v6-14-00-patches upstream/v6-16-00-patches [musinsky@strela root]$ git checkout upstream/^C # nove clonovanie do novej dir [musinsky@strela AAAAAAAAAAAAAAAAAAAAAAAa]$ git clone git@github.com:musinsky/root.git Cloning into 'root'... [musinsky@strela AAAAAAAAAAAAAAAAAAAAAAAa]$ cd root/ [musinsky@strela root]$ git checkout<TAB> Display all 389 possibilities? (y or n) [musinsky@strela root]$ git checkout upstr^C # no upstream branches [musinsky@strela root]$ git remote -v origin git@github.com:musinsky/root.git (fetch) origin git@github.com:musinsky/root.git (push)
dalej
Global setup:
Set up git git config --global user.name "Jan Musinsky" git config --global user.email musinsky@gmail.com
Next steps:
mkdir AliRsnOutManager cd AliRsnOutManager git init touch README git add README git commit -m 'first commit' git remote add origin git@github.com:musinsky/AliRsnOutManager.git git push -u origin master
Existing Git Repo?
cd existing_git_repo git remote add origin git@github.com:musinsky/AliRsnOutManager.git git push -u origin master
Importing a Subversion Repo?
Click here
When you're done:
Continue
https://github.com/github/markup#readme
git ls-remote --heads http://root.cern.ch/git/root.git git ls-remote --heads http://root.cern.ch/git/root.git | sed 's?.*refs/heads/??' git ls-remote --tags http://root.cern.ch/git/root.git git clone -b v5-34-09 http://root.cern.ch/git/root.git git clone -b v5-34-00-patches http://root.cern.ch/git/root.git # this need
git clone --depth 10 git://github.com/emacsmirror/emacs.git
last 10 commits
- http://git-scm.com/book/en/Git-Internals-Maintenance-and-Data-Recovery#Removing-Objects
- https://help.github.com/articles/remove-sensitive-data
git clone git@github.com:11350525.git
Summary:
git add -A # stages All git add . # stages new and modified, without deleted git add -u # stages modified and deleted, without new
git add . # add to index only files created/modified and not those deleted git add -u # add to index only files deleted/modified and not those created git add -A # do both operation at once, add to index all files
"git add -A" is equivalent to "git add .; git add -u".
git status git add . git status git commit -m "find multiple hits per one channel" git commit -a -m "macros cleanup" git status git push git push origin master # git status
git checkout mvala-mini-aliroot porbobit, commit git push origin mvala-mini-aliroot
zmenil som napr. manualne na githube, preniest zmeny z 'origin'(remote) do 'master'(local) git pull origin master
http://jenyay.net/Programming/Git
Теперь в обоих этих ветках содержатся одинаковые исходники, но в ветке "hello" остается старый файл hello.py, но нас это не должно волновать, так как больше нам эта ветка не понадобится. Давайте ее удалим, для чего выполним следующую команду:
git branch -d hello
Здесь параметр -d говорит, что ветку "hello" нужно удалить. При этом обязательным условием является то, что изменения в указанной ветке обязательно должны быть предварительно слиты с другой веткой. Если это не так, а удалить ветку все-таки надо, то вместо параметра -d нужно использовать параметр -D.
В Git, в отличие от SVN, есть одна, возможно неприятная, особенность. Дело в том, что при клонировании файл exclude будет создан пустым, и его придется заполнять заново. Также не будут клонированы локальные для репозитория настройки из файла config. Об этом надо помнить, если вы используете какие-то локальные настройки, ну а про файлы-исключения приходится помнить всегда.
Чтобы отправить изменения родителю достаточно выполнить следующую команду:
git push
До версии Git 1.7 эта команда была бы выполнена, но с длинным предупреждением о том, что вы собираетесь отправить изменения в удаленный репозиторий, но в данный момент с ним может кто-то работать, и это может быть причиной проблем. Начиная с версии 1.7 разработчики поступили просто: по умолчанию нельзя выполнять операцию push в удаленный репозиторий для веток (в нашем случае для ветки master), если в этом самом удаленном репозитории эта самая ветка является текущей (то есть над ней кто-то может работать). Поэтому начиная с версии Git 1.7 мы получим следующую ошибку:
~./bashrc
source /etc/bash_completion.d/git PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' alias vncserver='vncserver -geometry 1680x900'
./configure --with-pythia6-uscore=SINGLE --enable-roofit --enable-minuit2 --enable-gsl-shared --disable-editline --disable-globus
GitHub wiki:
![Example Chart](http://chart.apis.google.com/chart?chd=s:FZy&chs=100x100&cht=lc&chtt=Foo "Simple Line Chart")
svn export project_dir new_dir
delete tags
musinsky@musinsky strela]$ git tag 2013-11-29 strela_2010-06-24 strela_2010-11-11 strela_2013-11-29 [musinsky@musinsky strela]$ git push --delete origin <Tabulator> 2013-11-29 HEAD ORIG_HEAD origin/HEAD strela_2010-06-24 strela_2013-11-29 FETCH_HEAD master origin/gh-pages origin/master strela_2010-11-11
[musinsky@musinsky strela]$ git push --delete origin strela_2010-06-24 To git@github.com:musinsky/strela.git - [deleted] strela_2010-06-24 [musinsky@musinsky strela]$ git tag 2013-11-29 strela_2010-06-24 strela_2010-11-11 strela_2013-11-29 [musinsky@musinsky strela]$ git tag -d strela_2010-06-24 Deleted tag 'strela_2010-06-24' (was a706583)
[musinsky@musinsky strela]$ git push --delete origin strela_2010-11-11 To git@github.com:musinsky/strela.git - [deleted] strela_2010-11-11 [musinsky@musinsky strela]$ git tag -d strela_2010-11-11 Deleted tag 'strela_2010-11-11' (was c34286b) [musinsky@musinsky strela]$ git push --delete origin strela_2013-11-29 To git@github.com:musinsky/strela.git - [deleted] strela_2013-11-29 [musinsky@musinsky strela]$ git tag -d strela_2013-11-29 Deleted tag 'strela_2013-11-29' (was 5a6955c) [musinsky@musinsky strela]$
add tags
git tag -a v1.4 -m 'my version 1.4' git push origin v1.4
git push origin --tags # This will transfer all of your tags to the remote server that are not already there