¡Esta es una revisión vieja del documento!
bare parameter allows that:
ssh git@example.com mkdir my_project.git cd my_project.git git init --bare git update-server-info # If planning to serve via HTTP exit
cd my_project git init git add * git commit -m "My initial commit message” git remote add origin git@example.com:my_project.git git push -u origin master
git remote add origin ssh://estudiobay/repos/wallstreetjournal/demo.unity.git git remote add origin ssh://wikis/var/www/repos/shellscripts/
git remote add newskid ssh://newskid/home/ubuntu/repos/backend.git git push newskid
git clone ssh://estudiobay/repos/fcbarcelona/gamepass.android.git/
git remote -vgit statusgit loggit remote -vgit show REVISION:path/to/fileRemove file without removing from directory:
git rm --cached mylogfile.log
For a directory:
git rm --cached -r mydirectory
$ git reset --hard HEAD~ $ git push -f
$ git commit -A
$ git reset HEAD path/to/unwanted_file
git checkout -b [name_of_your_new_branch]git checkout [name]git push origin [name_of_your_new_branch]git branchgit branch -d the_local_branchgit push origin :the_remote_branchgit checkout -b my_new_branch git commit
git branch -D no_queues
git checkout -b <local_name> <remote_name> git checkout -b no_queues remotes/origin/#001_no_queues
git stashgit stash listgit pop stash@{1}git stash cleargit checkout 45a33 (it's not needed to put all the identifier)git checkout mastergit branch
List tags: git tag -l
Create a tag in the current commit: git tag -a 2.4.5
Upload tags to the remote: git push origin –tags
You need to set denyCurrentBranch
$ git init $ git config receive.denyCurrentBranch ignore <then you can push> $ git checkout <desired_branch>
If you want to return to the default behavior:
$ git config receive.denyCurrentBranch refuse
And to update:
git reset --hard
Create a submodule linked directly to the theme’s GitHub repository in order to receive updates:
$ git submodule add https://github.com/tomanistor/osprey.git themes/osprey $ git submodule update --init --recursive --remote
To update a downloaded repo with submodules:
$ git submodule init $ git submodule update
git config --global core.editor "nano -w"
To use it for the current repo:
$ git mergetool -t meld
To configure git to remember which merge tool you want, type git config –global merge.tool [tool]. For meld use:
$ git config --global merge.tool meld
You can have as many remotes as you want, but you can only have one remote named “origin”. The remote called “origin” is not special in any way, except that it is the default remote created by Git when you clone an existing repository. You can configure a second remote, push to/pull from that remote, and setup some branches to track branches from that remote instead of origin.
Try adding a remote called “github” instead:
$ git remote add github https://github.com/Company_Name/repository_name.git # push master to github $ git push github master # Push my-branch to github and set it to track github/my-branch $ git push -u github my-branch # Make some existing branch track github instead of origin $ git branch --set-upstream other-branch github/other-branch
$ git -C /home/alfred/Documents/workspaces/python/newskid.frontend push
For one day (86400), one hour (3600)…
git config --global credential.helper 'cache --timeout 86400'