Use following command to add files to git Interactively
git add -i
Use following command to add files to git Interactively
git add -i
Hey Guys, to achive new commit while merge, do following.
git merge --no-ff origin/theBranch
Solution 1
mysqldump -u root -p –max_allowed_packet=512M -B database –tables tblblogdb > dump.sql
You need to add switch –max_allowed_packet=512M
Solution 2
mysql> show GLOBAL variables like 'max_allowed_packet%';
+——————–+————+
| Variable_name | Value |
+——————–+————+
| max_allowed_packet | 1073740800 |
+——————–+————+
1 row in set (0.00 sec)
mysql>set global max_allowed_packet=100000000000;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like 'max_allowed_packet%';
+——————–+———+
| Variable_name | Value |
+——————–+———+
| max_allowed_packet | 1048576 |
+——————–+———+
1 row in set (0.10 sec)
http://help.github.com/git-cheat-sheets/
Notes extracted from git screencast at http://www.peepcode.com.
identify yourself to git: email and your name
git config --global user.name "David Beckwith"
git config --global user.email "dbitsolutions@gmail.com"
To view all options:
git config --list
OR
cat .git/config
git config --global alias.co checkout
cat .gitconfig
git config --global apply.whitespace nowarn
Some nice aliases:
gb = git branch
gba = git branch -a
gc = git commit -v
gd = git diff | mate
gl = git pull
gp = git push
gst = git status
git init
Add a file in the root directory called .gitignore and add some files to it: (comments begin with hash)
*.log db/schema.rb db/schema.sql
Git automatically ignores empty directories. If you want to have a log/ directory, but want to ignore all the files in it, add the following lines to the root .gitignore: (lines beginning with ‘!’ are exceptions)
log/*
!.gitignore
Then add an empty .gitignore in the empty directory:
touch log/.gitignore
git add .
git status
git commit -m "First import"
git ls-files
git rm [file name]
git commit -a
git add [file name]
git commit -v
git commit -m "This is the message describing the commit"
git commit -a
git commit -a -v
git log
git log --stat
git log -v
gitk --all
git tag "v1.3"
git push --tags
git branch [name of your new branch]
git push origin [new-remote]
git fetch origin [remote-branch]:[new-local-branch]
git branch
git branch -a
The state of your file system will change after executing this command.
git checkout [name of the branch you want to switch to]
OR
git co [name of the branch you want to switch to]
git rebase master
First, switch back to the master branch:
git co master
Check to see what changes you’re about to merge together, compare the two branches:
git diff master xyz
If you’re in a branch that’s not the xyz branch and want to merge the xyz branch into it:
git merge xyz
git reset --hard ORIG_HEAD
Remove the markings, add the file, then commit.
git checkout -b [name of new branch]
git stash save "Put a message here to remind you of what you're saving to the clipboard"
git co [branch you want to switch to]
Do whatever
Then switch back to the stashed branch
git co [the stashed branch]
git stash list
git stash apply
Now you can continue to work where you were previously.
git branch -d [name of branch you want to delete]
git branch -D [name of branch you want to delete]
git stash clear
Copy up your repository. e.g.:
scp -r my_project deploy@yourbox.com:my_project
Move your files on the remote server to /var/git/my_project
For security make the owner of this project git
On the repository server:
sudo chown -R git:git my_project
Then (for security) restrict the “deploy” user to doing git-related things in /etc/passwd with a git-shell.
git clone git@yourbox.com:/var/git/my_project
cat .git/config
By virtue of having cloned the remote repository, your local repository becomes the slave and will track and synchronize with the remote master branch.
git pull
laptop) without merging into your local branchgit fetch laptop
git merge laptop/xyz
This merged the (already copied laptop repository’s xyz branch) with the current branch you’re sitting in.
git remote show laptop
git push laptop xyz
git branch --track local_branch remote_branch
You do not need to specify the local branch if you are already sitting in it.
git pull
Note: You can track(link) different local branches to different remote machines. For example, you can track your friend’s “upgrade” branch with your “bobs_upgrade” branch, and simultaneously you can track the origin’s “master” branch (of your main webserver) with your local “master” branch.
By convention, ‘origin’ is the local name given to the remote centralized server which is the way SVN is usually set up on a remote server.
git remote show origin
git-svn clone [http location of an svn repository]
Now you can work with the checked out directory as though it was a git repository. (cuz it is)
git-svn dcommit
git-svn rebase
NOTE: make sure you have your perl bindings to your local svn installation.
git checkout -f
Before Installing VirtualBox from website. Install following packages.
yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-PAE-devel dkms
This should help virtualbox run properly