Browse cities

Git is one of the most popular version control systems in the world. Since its release more than 11 years ago it became a must have for web development specialists and web development agencies alike. Here is a list of very handy Git commands which you can use for app development or web development:

 

Setting details

git config --global user.name "John Doe" git config --global user.email john@example.com Use --global to set the configuration for all projects. If git config is used without --global and run inside a project directory, the settings are set for the specific project.

 

Ignoring file modes

cd project/ git config core.filemode false This option is useful if the file permissions are not important to us, for example when we are on Windows.

 

See current settings

git config –list

 

Clone a remote repository

git clone https://github.com/username/somerepo.git This creates a new directory with the name of the repository.

 

Get help for a specific command

git help clone

 

Create and Checkout a New Branch

git checkout -b

 

Checkout a Remote Branch

git checkout -b origin/

 

See differences between two commits

git diff COMMIT1_ID COMMIT2_ID

 

See recent commit history

git log

 

Abort Changes

git checkout --

 

Modify the Previous Commit's Message

git commit --amend

 

Partial Change Checkin

git add --edit

 

Undo the Previous Commit

git revert HEAD^

 

Temporarily Stash Changes, Restore Later

# After changes have been made... git stash # Do some other things here #Re-apply the changes git stash pop

 

Delete a Remote Branch

git push origin :

 

Pull in the Latest from a Shared Repository

# Add a remote branch git remote add # Get changes from that branch git fetch

 

Pushing, deleting and tagging tags

# Create a Tag git tag # Delete the tag git tag -d # Push Tags git push --tags

 

Making changes and creating patches

git diff > some_patch_1.patch

 

Adding files and creating patches

git add newfile git diff --staged > some_patch.patch

 

Applying patch patches

git apply -v some_patch_2.patch
 

 

Development

We do Web development

Go to our Web development page!

Visit page!

Recommended Stories

What’s New in Drupal 9? Any Game-Changing Features to Expect and... Prepare for?
These days, this is the question on the lips and minds of anyone developing/designing/creating content in Drupal… (Read more)
Adriana Cacoveanu / Sep 19 '2019
React.js vs Node.js: What Are the Main Differences? Which One to Choose for Building Your Next Web App?
They're both widely used, subsets of JavaScripts, high performing and yet... they're technically different. But… (Read more)
RADU SIMILEANU / Aug 1 '2019
Best of July: Top 5 Drupal Blog Posts that We Have Bookmarked this Month
It's that time of the month again! The time when we express our thanks to those Drupal teams who've generously (… (Read more)
Adriana Cacoveanu / Jul 31 '2019