Results: 1580
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
git checkout
Reverts all changes (from the last commit)
git checkout -- .
Reverts
some.txt
file changes from the last commit (to discard changes in working directory)
git checkout -- some.txt
HEAD will be detached and pointed towards the commit (to go back to master
git checkout master
should be run)
git checkout b4ba3088679ff70b45df2aefc7c0a13d41a2bd76
Reverts all changes (from the specified commit)
git checkout b4ba3088679ff70b45df2aefc7c0a13d41a2bd76 .
Reverts
some.txt
file changes (from the specified commit)
git checkout b4ba3088679ff70b45df2aefc7c0a13d41a2bd76 some.txt
To switch to an existing branch
git checkout another_branch
To switch to a new branch
git checkout -b new_branch
by Valeri Tandilashvili
4 years ago
0
Git
1
git commit
Saves staged changes to local repository with message
git commit -m 'Initial commit'
Adds all the modified and deleted files to staging area and then saves changes to local repository with message
git commit -a -m 'Initial commit'  /  git commit -am 'Initial commit'
Makes changes to the last commit, adds some files or edits commit message
git commit --amend -m 'Initial commit'
by Valeri Tandilashvili
4 years ago
0
Git
1
Set username and email globally
git config --global user.name "John"
git config --global user.email "johndoe@gmail.com"
Check if we have set the Git username and email globally
git config --global user.name
git config --global user.email
Set username and email for a single repository
git config user.name "John"
git config user.email "johndoe@gmail.com"
Check if we have set the Git username and email locally (for a single repository)
git config user.name
git config user.email
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorial - Learn Command-line Git & GitHub
1
pwd
To print the current working directory
pwd
also works on windows
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorial - Learn Command-line Git & GitHub
1
cd
Change directory
cd /Users/Brad/Desktop/Sites
Instead of typing the full path we can drag the folder on top of our command line
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorial - Learn Command-line Git & GitHub
1
To see remote URLs
git remote -v
Add remote repository URL
$ git remote add origin https://github.com/tandilashvili/testproject.git
Setting remote repository URL
git remote set-url origin https://github.com/tandilashvili/testrepo.git
by Valeri Tandilashvili
4 years ago
0
Git
Git & GitHub Crash Course For Beginners
1
Pushes new commits to the same remote branch
git push
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorial - Learn Command-line Git & GitHub
1
git pull
Download other developers commits from master branch to our local repository
git pull origin master
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorial - Learn Command-line Git & GitHub
1
PDO duplicate entry error code
We get the error code (using DB unique constraint) when the resource is already created
try{
    $stmt = $conn->prepare($query);
    $stmt->execute($exec_arr);
} catch(PDOException $e) {
    if($e->getCode() == 23000){
        array_push($errors, 'Technology already exists');
    } else {
        array_push($errors, 'Database error');
    }
}
by Valeri Tandilashvili
4 years ago
0
PHP
1
Download Git repository
git clone
Initialize local Git repository
git init
Add files to staging area
git add
Check status of working tree
git status
Save changes to local repository
git commit
Pull latest commits from remote repository
git pull
Push local commits to remote repository
git push
by Valeri Tandilashvili
4 years ago
0
Git
Git & GitHub Crash Course For Beginners
1
Results: 1580