0% found this document useful (0 votes)
48 views2 pages

Git Commands and Stashing Guide

The document provides instructions for basic Git commands used to initialize a Git repository, commit changes, work with branches, and push/pull from a remote repository. It covers initializing and configuring a local repository, making commits, cloning a repository from GitHub, viewing commit logs and status, creating and switching branches, stashing changes, merging branches, and adding/interacting with a remote repository on GitHub.

Uploaded by

waqarmwach
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views2 pages

Git Commands and Stashing Guide

The document provides instructions for basic Git commands used to initialize a Git repository, commit changes, work with branches, and push/pull from a remote repository. It covers initializing and configuring a local repository, making commits, cloning a repository from GitHub, viewing commit logs and status, creating and switching branches, stashing changes, merging branches, and adding/interacting with a remote repository on GitHub.

Uploaded by

waqarmwach
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
  • Git Log and History Tracking
  • Git Initialization Commands
  • Branch Management Commands

Chapter1:

$ git config --global [Link] �John Doe�


$ git config --global [Link] �john@[Link]�
$ git config --global [Link] auto

$ cd <path/to/project/folder>
$ git init

$ ls -la

git add -A
$ git commit -m �Initial commit"

$ cd your/development/folder/
$ git clone [Link]

$ git status

$ git add [Link] [Link] css/*

$ git commit -m �Implement the new login box�

$ git log

==========Chapter2
$ git branch contact-form

$ git branch -v

$ git status

$ git stash

$ git status

$ git stash list

$ git checkout contact-form

$ git add [Link]

$ git commit -m "Add new contact form"

$ git log

$ git checkout master


$ git log

$ git checkout master


$ git merge contact-form

$ git log

=================Chapter#3
$ git remote add origin [Link]

$ git remote -v

$ git branch -va


$ git fetch origin master

$ git fetch origin


$ git log origin/master

$ git pull

$ git checkout <branchName>

$ git push -u origin <branchName>

$ git branch -vva

$ git branch -d <branchName>

$ git branch -dr origin/<branchName>

git remote add origin


git remote add origin <"clone"> -f
git push origin master OR git push origin master -f
git clone repoName
git pull origin master

git push -u origin <branch> -f (push local brach on server)


git push --all -u (push all things on remote server)
git pull --all (pull all data from server)

Chapter1:
$ git config --global user.name John Doe
u0001
u0001
$ git config --global user.email john@doe.org
u0001
u0001
$ git config --globa
$ git fetch origin master
$ git fetch origin
$ git log origin/master
$ git pull
$ git checkout <branchName>
$ git push -u ori

You might also like