Created
July 20, 2017 06:08
-
-
Save umeshnrao/c8f26951ca03b40948d5ba4263ec4ae7 to your computer and use it in GitHub Desktop.
git command commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clone data from a remote repository to local machine | |
git clone <repo_url> | |
# Change dir to the downloaded repo | |
cd <folder_name> | |
# Show current branch | |
git branch | |
# Create a new branch for local development(maybe name it same as idsid) | |
git branch <branch_nm> | |
# Switch to the new branch | |
git checkout <branch_nm> | |
# pull from the remote repo | |
git pull origin <branch_nm> | |
# Gets details about the files | |
git status | |
### Create the required program source files / copy the files to the directory if they are present elsewhere | |
# Add the source files for tracking . Can specify individual file names or use wild cards | |
git add <filename> | |
### Addition of files can be verified using 'git status' | |
# Commit the added files/changes to local repo | |
git commit -m "Some comment about the change" | |
## it is a good practice to pull before pushing code changes when multiple people are working on same piece of code | |
# Push local changes to the remote repo | |
git push origin <branch_nm> | |
## This can be verified by logging into the github website | |
## Merging Branches ## | |
# Switch to the branch to which you intent to merge | |
git checkout <target_branch> | |
#Pull from remote repo to the target branch | |
git pull origin <target_branch> | |
# Merge with your updated branch. Provide the merge comments if prompted. | |
git merge <branch_nm> | |
# Push change to remote repo | |
git push origin <target_branch> | |
# Switich back to your branch | |
git checkout <branch_nm> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment