pushing and fetching from git

Process to do pull request: 
first all merge changes to the branch from which you clone the data from
Note
1. If you want to check if your repository is up to date?? 
what is the difference between GIT fetch or get much origin/develop

Let me tell you the process of how do the personal use git

Begin with they try to clone the data from git
Go to visual studio check for the source control section for changes

Then once you are done with verifying the changes made click on stage all changes

One staging is then click on commit by providing the comments

Vansh commity successful go to the folder where your scripts are located on windows from their do GIT bash like below

Then use 'git push' command line below

Once push is successful it means changes must be merged to your branch on bitbucket, go and check like this in the comment section on bitbucket.


Then go to pull request section too much your merge branch code to develop branch

Create pull request on top right

Once you click on the pull request button you see two things in the create pull request page, select source as your branch name and destination as develop

Note: you can check the differences by clicking different link ok to see the differences between develop branch and the the branch that you are pushing data from.

Just go to the click continue add description add reviewers and click submit. That is a pull request will be created and approval will get an email asking to review and approve.

Once your request is approved go and search pull request by clicking merge button.

≠==================

To pull data from GIT repository to local
- GIT clone minus b branch name clone URL
To clone copy the branch code on the local machine

- 'git merge origin/develop' to sync branch with develop so that you need not create branch updated if this does not merge use 'git fetch' then use 'git merge origin/ develop' command. When you do this it will show you what is the difference in the develop branch with the existing local branch. That is why merge command is used to integrate changes from another branch.

'git add filename' will add the file to staging

- git commit  -m comments' will add stage files to the commit

- 'git push' used to publish changes on to remote repo.

- reverse of GIT clone is GIT push

- to commit every change in git first use 'git add filenames' and then use command 'git commit - m comments'

- if you have lots of changed files in your working copy add and want to add all of them included in the next commit, you can make use of the the '-a' parameter and thereby omit the git add step.
'git commit - a -m comments'

- command used to check the state of your local GIT repository since your last commit is 'git status'

- command used to create a new branch 'git branch branchname'

- revert changes on to low on to working directory on git
To discard all local changes but save them for possible reuse later use 'git stash'
Discarding local changes permanently to a file 'git checkout - - filename'
Discard all local changes to all files permanently use 'git reset - - hard'

- difference between GIT pull vs GIT fetch'  -- git pull' command is used to fetch and download content from the remote repository and immediately update the local repository to match that contain merging removed upstream changes into your local repository is a common task in bigg base collaboration workflows

- discard stage and unstaged changes stage local changes before you commit first and stay is the file to current commit head user command 'git reset HEAD  filename'. 
2. unstage everything and retain changes use the command "git reset"
3. Discard all local changes but save them for later use the command 'git stash' 
4. discard everything permanently is the command 'git reset - - hard'


Scenario I have cloned a branch which was actually a replica of develop branch,  have been making changes to it locally, I got to know that somebody committed to develop branch.  So how do a push changes to develop branch now. 
 Steps of the files that are that you are working on exist on developed on modified in developed using the below:  commands 'git fetch' and then 'git merge origin/develop' if it throws below error it means the same files  have been modified, so before merging I have to commit the changes, so I commit the changes. now since it is completed I will do git merge origin/develop' , this will tell me now where are differences in files, if i go to files it will show me accept/reject changes on the files.

And if you have changes not associated the same file then you need not follow above approach just do GIT fetch and then do get merge origin/develop this will sink and keep both the changes

Comments